A study has found that diets containing certain food items can greatly affect the quality of sleep that a person gets.