To prevent the cake from sinking, be sure to use the correct sized pan the recipe calls for and bake it at the right temperature. Also, be sure not to disturb the baking process by opening the oven door or moving the pan in the oven while it's baking.