If you’re among the nearly 75% of Americans who enjoy a cup of joe daily—and also someone who works out regularly—you may be pleased to learn that the two rituals go together like coffee and cream. That’s because, according to research, pairing caffeine with exercise can improve how you feel and how you perform. “It’s a great performance enhancer,” Susan Kitchen , a Sports Certified Registered Dietitian (CSSD) and USA Triathlon and Ironman Certified Coach tells Fortune .

But she notes that caffeine—whether ingested through coffee , soda, or energy chews or drinks—can be a tricky supplement to incorporate into your exercise routine—and that it might not be right for some people at all. Here’s how to approach working out under the influence of caffeine. What is caffeine and how does it work? Caffeine is a stimulant found naturally in a range of plants, including coffee beans, cacao beans, kola nuts, tea leaves, and yerba mate, according to the Library of Medicine ; while it’s most often extracted from coffee beans, the kind of caffeine found in soda is largely produced synthetically in China, while sports nutrition products and other supplements may contain caffeine from either natural or synthetic sources.

The way that caffeine aids with energy is by blocking the action of the chemical adenosine, which promotes calmness, relaxation, and sleepiness. Recent studies have also shown it to be associated with a lower chance of diabetes and improved metabolism.