Cook the onions over low to medium-low heat, and stir them occasionally to ensure they cook evenly. If they start to catch, you can add a small splash of water to the pan to help deglaze and prevent burning.