Discount of 40% means that 40% of the original price was subtracted from the original price. Therefore, the sale price should be $50 (original price) minus 40% of $50 (discount). To represent this mathematically, it would be $50 - 0.4($50) = $50 - $20 = $30.
Alternatively, you could think of taking 40% off the original price as you having 60% left of the original price. Therefore, you could also get the sale price by calculating 60% of the original price. Mathematically that would be 0.6($50) = $30.