Research suggests that dietary habits, including intake of vegetables, caffeine, vitamins, and minerals, could modify melatonin production. Still, it doesn't have as big an impact as light exposure [12].
Exposure to blue light from phones, tablets, and TV screens can suppress melatonin production. If you're trying to get a wrap around your sleep issues, it's best to limit screen time in the evenings and dim the lighting in your home before bed.