When you eat large, complicated and meaty dinners, your body will have a harder time sleeping than if you eat light and simple meals at dinner. The problem becomes worse the later you eat, but even if you eat earlier, consuming a complicated meal affects your level of relaxation. Try it out for a few weeks, as I have, before you come to any conclusions.
I once ate a variety of four-item, vegetable only (no meat, no beans, no bread, no fruit) dinners for about four weeks. For example, one dinner might have been lettuce, tomatoes, celery and carrots and as much as I wanted of only those four foods. Somewhere in the third week I experienced calmer and deeper sleep than I ever thought a four-item dinner could be responsible for. It was a real surprise. Don’t knock it ‘till you try it. Your digestion can keep you awake (and affect the quality of your sleep).
You know, of course, that caffeine interferes with sleep, and this includes caffeine that is consumed in the afternoon, not just at night. Take a close look at how much caffeine you are ingesting. Even decaf drinks have been shown to contain significant caffeine (amounts vary depending on where you bought that decaf coffee). But there are other stimulating foods that also interfere with sound slumber. High fat foods, foods with tyramine (which produces a stimulating hormone, norepinephrine), chocolate, sugary foods, and alcohol all interfere with sleep. Keep these to breakfast and lunch as much as you can. Cigarettes are stimulating, and interfere with sleep. Alcohol may make you feel initially sleepy, but is disruptive to sleep, as is marijuana. Both promote REM sleep, which is less restful.