Preheat oven to 350°F (175°C). Line a 12-cup muffin tin with cupcake liners.
In a bowl, sift together flour, cocoa powder, baking soda, baking powder, and salt. Set aside.
In a separate large bowl, beat sugar and oil with an electric mixer until smooth. Add the egg and mix well.
Mix in vanilla extract and red food coloring until combined.
Alternate adding the dry ingredients and buttermilk to the wet mixture, stirring gently between each addition.
Add white vinegar and mix just until combined. Do not overmix.
Fill each cupcake liner about 2/3 full with batter.
Bake for 18–20 minutes, or until a toothpick inserted into the center comes out clean.
Let cupcakes cool completely on a wire rack before frosting.
For the frosting, beat softened cream cheese and butter until creamy.
Gradually add powdered sugar and vanilla extract, mixing until smooth.
Frost cooled cupcakes using a piping bag or butter knife. Decorate with optional sprinkles if desired.