I prefer tea, so I'll treat the question as "caffeinated beverages".
They do affect me, and, in the morning to early afternoon, that is a positive.
Later in the day? If I'm tired enough, I'll fall asleep anyway. But I find I'm more likely to waste time replying to threads in CFC OT (or playing EU4) if I've drank tea later in the day. There's a certain suppression-of-realizing-I'm-tired effect.
I typically have two teas per day, most often black or oolong. Today was a bit more than that, but green, which is less caffeinated. Coffee is generally more highly caffeinated than tea, regardless of the type.
Today I didn't have any tea at all in the morning, but I wasn't particularly productive in the morning, either. Got some tea after lunch, and my productivity went way up.
Is it all the tea? No. But I'm inclined to think it didn't hurt.
---------
Perhaps more so than caffeine, though, I've noticed that my last-afternoon productivity depends upon taking a mid-afternoon break and walking around. Getting that blood flowing, giving my brain a break from whatever it's focusing on.
Sometimes I have an extra cup of tea, without that physical break, and I fail to re-establish focus.
So, while caffeine can help, it isn't a panacea. It will help me avoid feeling like I should take a nap under my desk, but is not, by itself, enough for productivity.