THIS IS THE ANSWER. If you are following the right recipe and it is still sinking:
First try this in order.
1. Do not open the oven during baking until the very end.
2. When you think the cake is done, stick a small knife in the middle -- if it comes up clean then its done.
If after doing the two above and your cake is still "sinking when you take it out of the oven" and you are using a "MIXER OR STAND MIXER" then number three below is the problem.
3. Do not use a mixer - you are over mixing.
It only took me ten waisted cakes to realize this. Until one knows how to use a stand mixer or the right mixing speeds, "do not use" -- it will destroy a cake. I was using a kitchenaid mixer to mix all the ingredients. THE PROBLEM: OVERMIXING. Who would have guess making a cake is a science! How I figured it out was I decided not to use the mixer at all after destroying ten cakes. I changed and did everything by hand "the old fashion way". OMG.... the cake came out so perfect. OMG... never knew mixing or over mixing the batter could sink a cake!!!! So I tested it again and made another 9 cakes the old fashion way and not one problem with sinking. All came out beautifully.. Nice and moist -- oh so moist!!!!!!!!!!!
The best moist cake:
2 cups all purpose flour
2 teaspoons baking powder
1/2 teaspoon salt
1/2 cup unsalted butter, room temperature
1 1/4 cups sugar (or use ony 1 cup if you don't want it too sweet)
3 large eggs, room temperature
1 tablespoon pure vanilla
3/4 cup whole milk room temp
1/2 cup sour cream
My suggestion --- do it the "old way" -- by hand. If you want you can mix the wet ingredients in the mixer but "MIX IN THE FLOUR/DRY INGREDIENTS BY HAND". It will be the best cake you ever tasted!!!! no kidding.
Oh ... and don't forget to greese and flour the baking pan.