Don’t over fill your cupcake liners
Cupcakes use the walls of the cupcake liners or muffin pan to help them rise high. If you overfill the liners, there’s too much batter and not enough space to climb. The batter can spill over the sides and you’ll be left with flat cupcakes.
Every recipe is different, but as a general rule, I fill my cupcakes just over half full. You can also bake a test cupcake and see how it turns out before baking the rest.