Learning How to Control Thoughts and Emotions