This is an excellent question that a person on Quora asked so you have the benefit of learning from that answer.
am a certified trainer of hypnosis: Right before you go to sleep you are in a hypnotic state. So, if you play an affirmation as you fall off to sleep it will become a suggestion to your subconscious mind. Now here’s the real deal: the affirmation has to be something that you can realistically accomplish or it will not work. The subconscious mind will not take unrealistic suggestions.
You can also play your affirmation loop right upon awakening as you are in a hypnotic state at that time as well.
Do make sure that whatever you are programming your mind fior is safe and appropriate for you meaning that it is positive for you and the world at large.

Subscribe Now to the Dawning Visions Hypnosis Newsletter
If you found this blog post helpful and informative, then Suzanne would like to invite you to subscribe to the Dawning Visions Hypnosis Newsletter and receive notice of new blog posts, general news,special offers and upcoming events. A confirmation email will be sent to you and you will be granted access to the ever expanding free gift page which currently includes an anti-stress hypnotic induction mp3, an eating disorder induction mp3 and a pdf of the first chapter of Suzanne's upcoming book on sexual addiction.
Subscribe Now to the Dawning Visions Hypnosis Newsletter