Preheat the oven: Set it to 425°F (220°C). Lightly oil a baking dish large enough to hold the cod in a single layer.
Pat the fish dry: Use paper towels to remove excess moisture. Dry fish sears and bakes better, helping the surface firm up instead of steaming.
Make the olive-herb topping: In a bowl, combine chopped olives, capers, olive oil, garlic, lemon zest, lemon juice, parsley, dill, red pepper flakes, salt, and black pepper.
Stir until it looks glossy and well mixed.
Season the cod: Place the fillets in the baking dish. Sprinkle lightly with salt and pepper. Spoon the olive-herb mixture over the top, spreading it evenly.
Add a few thin lemon slices on each fillet if you like.
Bake: Cook for 10–14 minutes, depending on thickness. The cod is done when it flakes easily with a fork and turns opaque. Thicker fillets may need a minute or two more.
Rest and finish: Let the fish sit for 2 minutes.
Squeeze a bit more lemon over the top and taste for seasoning. Add a drizzle of olive oil if you want extra richness.
Serve: Pair with roasted potatoes, steamed green beans, or a simple couscous. The pan juices make a great quick sauce.