Prepare the Cupcakes:
Preheat your oven to 350°F (175°C). Line a muffin tin with cupcake liners.
In a medium bowl, whisk together the flour, baking powder, baking soda, and salt.
In a large bowl, beat together the softened butter and sugar until light and fluffy, about 2-3 minutes.
Add the eggs one at a time, beating well after each addition. Then add the vanilla extract and coconut extract, and beat until incorporated.
Gradually add the dry ingredients to the wet ingredients, alternating with the milk. Start and end with the dry ingredients. Mix until just combined.
Gently fold in the shredded coconut.
Divide the batter evenly among the cupcake liners, filling each about 2/3 full.
Bake for 18-22 minutes or until a toothpick inserted into the center comes out clean.
Let the cupcakes cool in the tin for 5 minutes before transferring them to a wire rack to cool completely.
Prepare the Coconut Frosting:
In a large bowl, beat the softened butter until creamy.
Gradually add the powdered sugar, one cup at a time, beating well after each addition.
Add the vanilla extract, coconut extract, and coconut milk, and beat until the frosting is smooth and fluffy. Add more coconut milk if needed to reach your desired consistency.
Once the cupcakes are completely cool, frost them with the coconut frosting using a piping bag or a spatula.
Optional: Toast the shredded coconut by placing it in a small pan over medium heat and stirring constantly until golden brown, about 3-4 minutes. Sprinkle the toasted coconut over the frosted cupcakes for extra flavor and texture.