Add the onion, red pepper flakes, and a generous pinch of salt to the pan and cook over medium-low heat, stirring often, until the onions are soft, translucent, and just beginning to gain color, about 5 to 7 minutes. Add the garlic and cook until fragrant, stirring constantly, about 1 to 2 minutes.