How sleep affects mental health