Found in tea, coffee, some types of fizz and energy drinks, caffeine stimulates alertness and reduces fatigue. It's effective immediately and remains active for 5 to 6 hours afterwards. The more you drink, especially later on in the day, the more caffeine present in your body when it's time to go to bed.
Even though everyone has varying levels of sensitivity to caffeine, avoid drinking it as far as you can, especially after 3pm, or opt for decaffeinated drinks which have practically the same flavour minus the disadvantages.