Add onion and sauté 2-3 minutes until onion starts to turn translucent.
Add garlic and stir a minute longer until garlic is aromatic but not brown.
Add spinach, salt, and pepper and stir to coat spinach in oil. Continue stirring every 30 seconds until spinach is wilted (about 4-5 mins). Do not continue cooking once spinach is done wilting - immediately remove from heat.
Add lemon juice and red pepper flakes (if desired) and stir. Adjust saltiness if needed. Transfer to a serving dish with a slotted spoon to drain out the juices.