Updated: Feb 27
People vary wildly in their use and response to caffeine. If your current system is working, no need to mess with it.
As you are awake, adenosine builds up. The buildup of adenosine over 12-16 hours is part of what's called "sleep pressure". Caffeine binds to the adenosine receptors and thus blocks some of our perception of fatigue. The typical half-life for caffeine is 6 hours, so if you're the "average" person, there would still be some in your system 12 hours later. This explains why most people learn that to sleep well, there's a time after which they shouldn't drink coffee. This varies with the person and in the same person over the lifespan. Caffeine 6 hours before bed reduces total sleep time and deep sleep in particular. Since sleep quality tends to erode with age, it's like you have the sleep of a person twenty years older. Again, these are averages, but worth considering as you choose your caffeine level for the day.
Alcohol has a sedative effect and helps many people to fall asleep, especially if they are anxious. As with caffeine, there's a certain metabolic rate which varies with the person. Even though "one drink per hour" is the rough estimate we've learned for party pacing, the general metabolic effects last several hours and will spill over into sleep. The sedative effect can cause you not to remember the frequent awakenings that are noted in sleep studies with alcohol, and REM sleep is shortened. Since REM sleep relates strongly to mental health, this is worth considering if you have depression or anxiety. Also, alcohol raises the heart rate slightly, raises the core temperature, and has a slight diuretic effect, which may lead to waking in the middle of the night. All of these reduce sleep quality.
I enjoy coffee many mornings, and sometimes have a drink at night. No judgment here. But if you aren't feeling refreshed in the morning, or it's hard to unwind at night, this might be helpful to know.