Preheat your oven to 180°C (350°F). Line a 9-inch square baking pan with parchment paper, leaving overhang for easy removal.
Toss the oats on a baking sheet and toast in the oven for about 8-10 minutes until fragrant and golden, stirring halfway through.
In a small saucepan over medium heat, melt the butter until it bubbles gently and releases a nutty aroma, about 2-3 minutes.
Add the brown sugar, honey or maple syrup, and vanilla extract to the melted butter. Stir until the mixture is smooth, glossy, and slightly thickened, about 2 minutes.
In a large mixing bowl, combine the toasted oats, sea salt, and toasted shredded coconut if using. Mix well to evenly distribute.
Pour the hot butter mixture over the dry ingredients and stir thoroughly until the oats are coated and sticky, about 1-2 minutes.
Transfer the mixture into your prepared pan and press down firmly with the back of a spatula or moist fingers to create an even, compact layer.
Bake for 20-25 minutes, until the edges are golden brown and the center feels set but slightly soft when pressed.
Remove from the oven and let cool in the pan for at least 15 minutes to allow the bars to set and become easier to cut.
Lift the bars out of the pan using the parchment overhang and place on a cutting board.
Cut the cooled bars into squares or rectangles with a sharp knife, about 1.5 inches each, and serve.
Enjoy your homemade oatmeal bars warm or at room temperature. Store leftovers in an airtight container for up to 3 days.