Don’t depend on willpower. Lower (or increase) friction. If you have trouble with not eating cookies, increase friction by keeping them out of sight, or just don’t keep them in the house. If you have trouble getting to the gym, reduce friction by getting everything ready the night before - put coffee or your workout drink in an insulated flask, have your gym clothes out (or sleep in them), etc. If you have trouble waking up in the morning, increase friction (for staying in bed) by moving your alarm clock to the other side of the room.