Your equation is 24x + 16 = 52 where x is the cost of each individual cupcake.
First step is to take away the 16 from each side so that we only have the cupcakes to deal with the overall cost without the cake.
52 - 16 = 36.
Your new equation is 24x = 36
Divide both sides by 24 to isolate the variable x.
x = 36/24 = 1.5 or 1.50
The cost of each cupcake is $1.50.