The body naturally produces melatonin, but you can also get it from foods such as nuts, eggs, and salmon. These melatonin-rich foods also have other nutrients that support better sleep quality, too.