To prevent the garlic from becoming bitter, fry it on medium-low heat. If the garlic starts to brown too quickly or becomes bitter, lower the heat and adjust the cooking time accordingly.