This is another way of thinking about how misery loves company. Energy tends to attract similar energy, whether it is good or bad energy. If you are sending out negative thoughts constantly, you are probably going to get that negative energy back. On the other hand, if you can put all mostly positive energy, then you will get the positive energy back. This is the core of why positive thinking works in your favor and why you should start embracing it more in your regular life. 
Read more