In a large pan over medium heat, heat oil. Add garlic and cook until fragrant, 1 minute. Add anchovies and cook until fragrant, another minute. Add tomatoes, olives, capers, and red pepper flakes. Bring to a boil, then reduce heat and let simmer, 15 minutes.