I love caramelized onions, especially the burnt bits at the bottom. But those also tend to stick to the pan and are difficult to scrape off. The Kitchn recommends adding a little bit of water at the end of cooking, while the pan's still on heat, to loosen that delicious crusty part.
It's a simple process. At the end of cooking and before you add the water, remember to first turn the heat up high.
Pour in about 1/4 cup of water. It should immediately steam up. This is your golden moment (they didn't call it steam power for nothing). As the water steams in the pan, use your spatula to aggressively scrape. You should find that any spot of crust that the water and steam touch is easily scraped up.
The water will evaporate and it won't make your dish soggy, so don't worry about that. In fact, this process of adding a little water and letting it evaporate over high heat helps to concentrate flavours, as well as clean the pan.
The added benefit is that like with a slow cooker, this trick also cleans up your pan in the process.
The Kitchn notes that this is basically a technique called deglazing. In case you didn't get all the crust, you can repeat the process of adding water. And if you just want a clean pan, take your food out of the pan first and then add water.