cakes usually sink when the cake batter is not completely cooked. everyone's ovens are different so you need to find the optimum baking time for your own oven. towards the end of baking, test the cake repeatedly to see if it is fully baked.