Preheat your oven to 350°F (175°C). Line a muffin tin with cupcake liners.
In a large bowl, whisk together the flour, sugar, cocoa, baking soda, and salt.
Add the egg, oil, buttermilk, food coloring, vanilla, and vinegar. Whisk until smooth.
Divide batter evenly among the liners, filling each about two-thirds full.
Bake for 18–20 minutes, until a toothpick inserted comes out clean. Let cool completely.
For the frosting, beat cream cheese and butter until creamy.
Add powdered sugar gradually, mixing until smooth.
Beat in vanilla extract until fully combined.
Frost cooled cupcakes generously and enjoy.