Let's consider the very beginning of the thought/emotion process. Before you start thinking about anything or even forming an emotional reaction to it, you see a multitude of objects and situations in your mind and in real life. Few of those objects and situations attract your attention, and even fewer attract your interest. But what is interest?
Imagine seeing a house, a car, a career, or anything else that you wish you had. A mere instant after you saw it either in reality or your imagination, you feel a tickling rush of joy in the center of your chest. You experience this joy because to your mind, the moment you wished to possess or achieve something, you've already accomplished it. After you experienced joy in relation to the object or situation, you realize that you want to possess or achieve that something in real world. Now the question that you're facing is whether or not you want it enough to actually do something about it or you'd rather save your time and energy for something else. If you decide to move on, then you'll have a feeling of lesser or greater disappointment, or anger, or another feeling that will stay with you for the rest of your life. If you choose to after that goal, then your state of mind will be somewhat different. On one hand, you'll have the feeling of satisfaction if you accomplish the goal that you'd set for yourself, similar to the one that you had experienced when you felt interest at the very beginning of this cycle. But on the other hand, your accomplishment will always look and feel different from how you imagined it would, and they will include a smaller or greater number of trade-offs.
So in a nutshell, your thoughts and emotions are interlocked, and they all always rest on your mental attachments. (If you want to know more about this process and how to regulate it, read the chapter on Goal Setting in my book Secret Techniques for Controlling Sadness, Anger, Fear, Anxiety, and Other Emotions.)