Chop the shallot or onion and mince or grate the garlic. Gently warm the cream or half-and-half so it's no longer cold. This helps prevent the sauce from separating.
Make the sauce:
Heat a large pan over medium-high heat. Once hot, melt the butter. Add the chopped shallot (or finely chopped onion) and lemon zest and sauté for 2 minutes, until it’s translucent and golden. Add the garlic and sauté it for about 30 seconds until fragrant. Add the chicken broth and stir to combine.
Add the warmed cream, thyme, and simmer gently for 10 minutes.
Check the consistency. The sauce should lightly coat the back of a spoon. If you want it thicker, mix 1 tablespoon cornstarch with 3 tablespoons water in a small dish. Stir the slurry into the sauce and gently simmer for 2 more minutes, until thickened. When using heavy cream, the sauce is usually thick enough and this step can be skipped. Once the sauce has thickened, stir in the lemon juice.
Serve:
Toss the lemon garlic sauce with freshly cooked pasta, spoon it over chicken or salmon, or serve it with roasted vegetables. For pasta, add a splash of reserved pasta water if needed to loosen the sauce.
Notes
Swap the shallot for ¼ of cup finely chopped onion (about ½ small onion).
If you want to use garlic powder, use 2 teaspoons instead of the whole garlic cloves.
Notes on dairy: Whole milk yields a very thin sauce, whereas half-and-half is creamier, and cooking cream or heavy cream yields a richer, creamier sauce.