Moderate exercise can help you sleep better and give you more energy while awake. Aim for a 20- to 30-minute routine 3 or four 4 a week. Tailor the workout to your physical condition, and exercise in the morning or afternoon, not close to bedtime. Check with your doctor about how much and what type of exercise is right for you.