It's a vicious cycle. You don't sleep well because you don't exercise and then you don't exercise because you don't sleep well.
Recent research has found that sleep deprivation is a key player in inactivity as feeling sluggish or lacking energy during waking hours isn’t very conducive to exercise motivation and can cause excessive inactivity. Get enough sleep by prioritizing your day and trying to get to bed a little bit earlier so that you're rested and ready to get up and move. Once you put an end to one vicious cycle, you'll start to see a new happier cycle emerge: you're sleeping well because you're exercising and you're exercising more because you're sleeping well.