I used to have trouble sleeping. We're not talking minor trouble, we're talking at least an hour each night, tossing and turning. And often I couldn't sleep at all. I'd lay in bed, bored, for two or three hours, get up and putter around for an hour, try again for a couple of hours, then get up and go to work. This especially happened when I had an important meeting or a plane trip or something else I had to get up for.
People used to tell me to cut out the caffeine, but I pretty much ignored them. I only had about two cups of coffee a day (or equivalent in sodas). And I never took caffeine past about 5pm or so.
Then about a year ago I had to cut my caffeine in half because of acid reflux and only drink it in the morning. My sleeping problem have almost completely disappeared.
So, if you have trouble sleeping, try cutting back on caffeine, even if you don't drink a lot now.