how do you work out a pecentage of something?

To take for example 15% of something (for example 40):

1. Divide the percentage by 100 to get a decimal fraction. 15/100 = 0.15

2. Multiply by that fraction. (for example 0.15 * 40 = 6