Add garlic to the pan after the onions have softened and become translucent, and keep the heat at medium-low. Stir frequently to prevent burning.
Garlic burns easily because it contains sugars and has a lower moisture content compared to onions. When sautéing garlic with onions, follow these steps to prevent burning:
Start with the Onions: Begin by sautéing the onions first. Cook them over medium heat until they become translucent and softened. This usually takes about 5-7 minutes.
Lower the Heat: Once the onions are softened, reduce the heat to medium-low. This will help prevent the garlic from burning quickly.
Add the Garlic: Add the minced or chopped garlic to the pan. Ensure it's evenly distributed.
Stir Frequently: Stir the garlic and onions constantly. This prevents the garlic from sitting in one spot and burning.
Watch Closely: Garlic cooks very quickly. It should only take about 30 seconds to 1 minute for the garlic to become fragrant and lightly golden. Remove from heat immediately if it starts to brown too quickly.
Consider Adding Liquid: If the pan seems too dry, add a tablespoon of water, broth, or oil to help regulate the temperature and prevent burning.
Use larger pieces of garlic (like slices instead of minced) if you're prone to burning it. Larger pieces take longer to cook and are less likely to burn before the onions are ready.