$$Notice that 40 is really the same thing as $\frac{40}{1}$\\
So now we have:\\
$\frac{3}{5} \times \frac{40}{1} = \frac{3\times40}{5\times1} = \frac{120}{5}\\$
We can reduce this fraction by dividing the top and bottom by 5\\
$\frac{120 \div5}{5\div5} = \frac{24}{1} = \mathbf{24}$$$
$$Notice that 40 is really the same thing as $\frac{40}{1}$\\
So now we have:\\
$\frac{3}{5} \times \frac{40}{1} = \frac{3\times40}{5\times1} = \frac{120}{5}\\$
We can reduce this fraction by dividing the top and bottom by 5\\
$\frac{120 \div5}{5\div5} = \frac{24}{1} = \mathbf{24}$$$