Avoid caffeine, especially after midday. This includes coffee, tea, chocolate, and many sodas. Coffee has a half-life of four to six hours. That means it takes that long for half of the coffee to be digested, and another four to six hours for the next quarter of it to be eliminated from your body. No wonder you still feel wide awake at eleven when you had your last cup after dinner.
Sugar can also cause problems.
Consider avoiding refined sugar in the evening because it is absorbed immediately into the bloodstream. That's why it gives you a burst of energy and sometimes makes you feel a little high. Eating sugar near bedtime can make you restless and jittery and can keep you from falling asleep. If you need a treat at bedtime, a glass of warm milk is your best bet. Alcohol and tobacco taken near bedtime can also interfere with deep sleep.