If a cake sinks, check this order: underbake, wrong oven temp, over-aerated batter, or too much leavening.
Confirm doneness with a skewer and center spring-back. Avoid opening oven in the first half of bake unless absolutely necessary.
Use correct pan size from recipe; oversized pans alter structure.