Preheat your oven to 350°F (175°C) and prepare two 9-inch round cake pans by greasing and flouring them.
In a large mixing bowl, whisk together the flour, sugar, baking powder, and salt. Stir in the shredded coconut and crushed pineapple.
In another bowl, beat the softened butter until creamy. Add the milk, eggs, vanilla extract, and coconut extract, mixing until well combined. Gradually add this wet mixture to the dry ingredients and stir gently until just combined.
Divide the batter evenly between the two prepared cake pans and bake for 25-30 minutes. Check for doneness with a toothpick.
Allow the cakes to cool in the pans for about 10 minutes, then transfer to wire racks to cool completely.
To make the frosting, beat the softened butter until creamy, then gradually add the powdered sugar, mixing until smooth. Add the vanilla extract and heavy cream, beating until fluffy.
Once the cakes are completely cool, place one layer on a serving plate, spread frosting on top, and then place the second layer on top. Frost the top and sides of the cake and garnish with shredded coconut.