Preheat the oven to 350°F (175°C) if using a glass or ceramic baking dish. For a metal pan, set the oven to 325°F (163°C). Line an 8×8-inch baking dish with parchment paper and lightly grease the sides and bottom.
In a large bowl, whisk together the flour, sugar, cocoa powder, baking powder, baking soda, and salt.
Add the egg, milk, vegetable oil, and vanilla extract. Mix on low speed until combined, then increase to medium and mix for 2 minutes.
Stir in the warm water or coffee until fully incorporated. The batter will be thin.
Pour the batter into the prepared baking dish and bake for 35-40 minutes or until a toothpick inserted in the center comes out with a few crumbs but no wet batter.
Let the cake cool in the pan for 10 minutes, then transfer to a wire rack to cool completely.