Foods that contain melatonin, tryptophan, certain carbohydrates and magnesium are those that aid sleep, but they work in different ways and are contained in a variety of foods.
Melatonin: The hormone that the body naturally produces as the sun sets, can be found in Tart cherries, nuts (pistachios, cashews, almonds and walnuts), eggs, and milk. Though not all milk is the same, studies have shown that ‘night milk’ (milk that has been milked at night) contains up to 10 times more melatonin as day milk). It also was shown to have a sedative, anxiety-reducing, and sleep-promoting effect.
Tryptophan: An amino acid that the body converts into serotonin, it is found in fatty fish, turkey, chicken, cheese, soybeans and tofu. It helps with mood regulation, sleep support and niacin production.
Magnesium: An essential dietary mineral. There are 7 types of magnesium all of which have a slightly different action in the body. Magnesium glycinate being one of the best for sleep, it is highly absorbable, calms the nervous system, and is known for being gentle on the stomach. Or Magnesium L-threonate which is able to cross the blood-brain barrier more effectively, making it great for maintaining deep sleep and reducing next-day brain fog. Magnesium can be found in bananas, pumpkin seeds, oats and spinach
Complex Carbohydrates: Help to stabilise blood glucose and promote serotonin release. They can be found in among other things whole wheat toast and oats
Some honorable mentions: There are some foods that help with sleep including kiwi (which researchers relate to the antioxidant properties) and chamomile Tea of which apigenin, (a flavonoid found in chamomile tea, is thought to be the compound that produces the sleepy effect.)
Lastly foods that can interfere with sleep include spicy, high saturated fat, high sugar, acidic and caffeinated foods
When in doubt talk to a health care professional or a dietician
Foods That Help You Sleep
https://www.hopkinsmedicine.org/health/wellness-and-prevention/better-sleep-3-simple-diet-tweaks