Wash hands with soap and water for 20 seconds.
Do not taste or eat any raw dough or batter made with uncooked flour and/or raw eggs.
Preheat oven to 350°F.
Butter and flour two 9-inch pans, three 8-inch or one 9x13 pan. Line bottoms with parchment paper. (Not necessary for the 9x13-inch pan unless you are going to remove the cake from the pan. See Note 1.) For cupcakes, line with cupcake liners and give each a small spritz of non-stick spray.
In a large bowl, beat sugar and oil until combined. Scrape down bowl sides.
Add sour cream, eggs and vanilla. Mix on medium until combined. Scrape down bowl sides.
Sift together flour, cocoa, baking soda, baking powder, and salt.
Add the flour and buttermilk one third at a time, starting with the flour and ending with the buttermilk. Beat on medium speed until combined. Scrape down bowl sides.
Very slowly add the hot water. Beat or stir until just mixed. (Be careful—the hot water may splash.)
Bake the cake 25-30 minutes for 8-inch pans, 30-35 minutes for 9-inch pans, 30-35 minutes for a 9x13-inch pan, or 15-18 minutes for cupcakes and the tops of the cakes spring back when gently touched or until a toothpick inserted comes out clean. The internal temperature of the cake should be 200°F. Do not overbake! Do not open oven until just before testing cakes. Opening the door too soon may cause the cakes to fall in the middle. Cool 10 minutes in pans. Turn out the layers onto cooling racks and remove the parchment paper if using. Cool completely and frost as desired.