When things aren't going our way, we must remember this is all an illusion. Firstly we need to realize everything gets worse before it gets better. This is referred to as "The Law of Opposites". A forest must burn down so the right nutrients can form in the soil and rejuvenate the woods; we must go through a break-up in a good relationship in order to be led to the right person and have a GREAT relationship; we must lose our ok job before we end up at our dream job, etc. So when we feel knocked down, remember it is all an illusion, leading us to better things. Everything is always working out for our highest good - we just need to be patient.
Secondly, we need to remember that although everything SEEMS like physical matter, at its root it is all just energy. We are made up of mostly empty space, just like everything else. Nothing is as it seems. And because of this, the energy we put behind things impacts the energy within, and the energy out in the world. So rather than feeling down about our situation, we can begin observing it from an energy perspective, with the understanding that the energy we bring to the situation will impact the outcome. This is referred to as "The Law of Attraction."