Caffeine and Sleep
Caffeine has a half-life of five to six hours, meaning it can linger in your system long after consumption, affecting your sleep quality. Even if you feel fine falling asleep after a late espresso, you may be sacrificing deep sleep, leaving you feeling unrefreshed in the morning. Limiting caffeine intake to before midday and keeping it to a maximum of three cups can help maintain better sleep health. For evening enjoyment, opting for decaf can be a wise choice.In this clip
From this podcast

The School of Greatness
POOR SLEEP Is Killing You! - DO THIS To Optimize It TODAY! | Matthew Walker & Lewis Howes
Related Questions
Caffeine has a half-life of approximately 5 to 6 hours, meaning that a significant amount remains active in your system long after consumption. If you drink coffee in the afternoon, a quarter of that caffeine could still be present by midnight, making it challenging to fall asleep at a reasonable hour.
How can I manage my caffeine intake to avoid sleep issues?