Regular exercise reduces stress and anxiety, and generally improves sleep. But for some people, exercising within five hours of bedtime may cause problems getting to sleep.
Keep in mind, everyone's different. For some people, late-day exercise isn't a problem. It may require some trial and error to see how working out affects the quality of your sleep. Without making any other changes that are likely to affect your sleep, take notes on how well you sleep after working out at different times. This can help you determine the time of day that's best for your workout and the least disruptive to your sleep.