Preheat oven to 350 degrees. Butter two 9-inch cake rounds and line the bottom with parchment paper.
In a large bowl or stand mixer, stir together flour, sugar, cocoa, baking soda, baking powder, and salt until combined.
Add eggs, buttermilk, warm water, oil, and vanilla. Beat on a medium speed until smooth.
Divide batter evenly between the two pans. Bake for 30-35 minutes until a toothpick inserted into the center comes out clean.
Cool on wire racks for 15 minutes and then turn out the cakes onto the racks and allow to cool completely.
Coconut Pecan Filling
Melt butter in a medium saucepan over medium heat. Whisk in sugar and brown sugar until combined.
Add in egg yolks, evaporated milk, and vanilla extract. Cook over medium heat for 12 to 14 minutes until thickened, stirring frequently.
Remove from heat and stir in coconut flakes and pecans. Let cool completely before assembling cake.
Chocolate Buttercream (optional)
Make the frosting by In a large bowl, beat butter until fluffy using a hand mixer. Add in cocoa powder and vanilla extract. Beat until combined. Add in 1 tablespoon milk or cream to thin out. Beat in powdered sugar, 1 cup at a time, beating in between until combined. Add up to two more tablespoons milk or cream as needed to achieve a spreadable consistency. Transfer to piping bag(s) for frosting.
Use half of the coconut pecan filling and spread in between the two chocolate cake layers. Spread the other half on top of the cake.
If using buttercream, spread the frosting on the outside of the cake and use a piping tip to decorate the top edge.