Diet plays a substantial role in managing insomnia. Avoiding heavy meals close to bedtime, moderating caffeine intake, and steering clear of stimulating drinks or foods can aid in promoting better sleep. Opting for sleep-promoting foods like herbal teas, nuts, bananas, or foods rich in magnesium can contribute positively to sleep quality.