When you are in your Alpha brainwave state, which means you are between being completely awake and completely asleep, you are the most suggestible. That makes the time just before you go to sleep the best time to write out a few affirmations about positive changes you'd like to bring into your life. You can also write them upon awakening in the morning, but most people find it easier to do them at night.
It's also a great idea to write them instead of simply thinking about them or stating them aloud, because writing is an ideomotor activity. That means it makes use of the mind and the body, which are intimately connected and each very important in the implementation of changes.
For example, if you'd like to improve your sleeping patterns, you might try, "Tonight I sleep peacefully and restfully." If your goal instead is to lose weight, you could write something like, "I enjoy eating healthy foods and taking good care of my body." And if you'd like to increase your income, you might use something like this: "I attract money from unexpected sources."
Some people maintain that there's a magic number of times to do something to make it permanent in your life. Since there doesn't seem to be much agreement on what that number is, I'd recommend doing this exercise as frequently as possible. If nothing else, the more you think about something, the more likely you are to bring it into your life. Writing about it may well cause you to think about it as you sleep in addition to when you're awake.