Preheat the oven: Set your oven to 400°F (200°C).
Line a baking sheet with parchment for easy cleanup.
Prep the green beans: Toss the trimmed beans with olive oil, a pinch of salt, and black pepper. Spread them on the baking sheet in an even layer, leaving space for the fish.
Make the lemon butter: In a small bowl, stir together melted butter, lemon zest, lemon juice, minced garlic, and a pinch of salt. Add Dijon or red pepper flakes if you’re using them.
Season the cod: Pat the fillets dry with paper towels.
Season both sides with salt and pepper. Place them on the baking sheet next to the beans.
Sauce the fish: Spoon the lemon-butter mixture evenly over the cod. If you have extra, drizzle a bit over the beans for added flavor.
Bake: Bake for 10–14 minutes, depending on the thickness of your fillets.
The fish is done when it flakes easily with a fork and turns opaque. Thinner fillets will cook faster.
Finish with herbs: Sprinkle chopped parsley or dill over the fish and beans. Add lemon slices or wedges for serving.
Serve: Plate the cod with a generous portion of beans.
Spoon any pan juices over the top for extra flavor.