Before you start making the cake, preheat your oven to 350°F (180°C). This will ensure that your cake is baked evenly and comes out perfectly.
In a large mixing bowl, combine 2 cups of all-purpose flour, 1 teaspoon of baking powder, and 1/4 teaspoon of salt. Whisk these ingredients together until they are well combined.
In a separate mixing bowl, beat 4 eggs and 1 cup of granulated sugar together until they are light and fluffy. Add the melted unsalted butter, 1/2 cup of dark rum, and 1 cup of brewed coffee (if using) to the egg and sugar mixture. Beat these ingredients together until they are well combined.
Gradually add the dry ingredients to the wet ingredients, mixing continuously until the batter is smooth. Do not overmix the batter, as this can cause the cake to become tough.
Pour the batter into a greased 9-inch (23cm) round cake pan. Tap the pan on the counter a few times to release any air bubbles.
Place the cake pan in the preheated oven and bake for 40-45 minutes, or until a toothpick inserted into the center of the cake comes out clean.
Once the cake is done baking, remove it from the oven and let it cool for 10-15 minutes in the pan. After that, transfer the cake to a wire rack to cool completely.