A number of lifestyle factors can affect your ability to fall and stay asleep. These include the activities you engage in before bed, whether you exercise and when, any medications you’re taking, what and when you eat, your exposure to natural sunlight and nighttime artificial light, and more. Because so many lifestyle factors can affect your sleep, a sleep journal can be really useful for keeping track of all these factors.