Preheat your oven to 350°F (175°C). Grease and line the bottoms of two 9-inch round cake pans with parchment paper.
In a large mixing bowl, whisk together the flour, sugar, shredded coconut, baking powder, baking soda, and salt until well combined.
In a separate bowl, whisk together the coconut milk, vegetable oil, eggs, vanilla extract, and coconut extract (if using) until smooth.
Pour the wet ingredients into the dry ingredients and mix until just combined. Be careful not to overmix.
Divide the batter evenly between the prepared cake pans and smooth the tops with a spatula.
Bake in the preheated oven for 25-30 minutes, or until a toothpick inserted into the center of the cakes comes out clean.
Remove the cakes from the oven and allow them to cool in the pans for 10 minutes. Then, transfer them to a wire rack to cool completely.
While the cakes are cooling, prepare the frosting. In a large mixing bowl, beat together the softened butter and cream cheese until smooth and creamy.
Gradually add the powdered sugar, one cup at a time, beating well after each addition. Mix in the vanilla extract until smooth and fluffy.
Once the cakes are completely cooled, place one layer on a serving plate or cake stand. Spread a layer of frosting over the top.
Place the second cake layer on top and frost the top and sides of the cake with the remaining frosting.
Garnish the frosted cake with shredded coconut, pressing gently to adhere.