Preheat a large skillet with olive oil on a medium-high heat. Season cod generously on all sides. Add the fillets to one half the skillet and add onions to the other half, cut side down, giving them 2-3 minutes to get a nice sear. While the onions are getting a clean sear, mound in your garlic and butter. Turn over the cod and cook until it's golden brown. Once the cod is golden all over, finish by removing the pan from the heat and adding a squeeze of lemon.