You have probably seen what are called ‘reversible figures’. For example, a picture of a vase that when looked at slightly differently becomes two faces. This involves a fast rearrangement of how your brain makes sense of an object. First you see the vase as the foreground and then as the background. The faces become the foreground. Changes in how we conceive of a visual object also applies to ideas and feelings and memories. For example, one can think of their present situation in two ways—positively or negatively. If you have just lost a great deal of money you feel bad. But if you remember that you at least have enough from a pension plan to avoid living on the street, you feel a bit better. “Things could be worse” you imagine. The two views reverse. This is similar to cognitive dissonance reduction. It is a form of rationalization that reduces feelings of conflict. As a result, mood gets better
This process can occur consciously or unconsciously. Many people can intentionally change perspectives. I have had more than a few patients who are anxious and depressed upon awakening from sleep. After getting out of bed they purposely think about their situation in a more positive way by focusing on different aspects of their life. Good aspects of a bad situation are focused on. This can help one get through rough times. For example, during the pandemic people think of how they are able to spend more time with family or how working from home eliminates hours of commuting to an office.
But often the positive and negatives views of things changes as with a reversible figure. Now you feel bad, then good, then bad again. Of course the best solution for being in a real, difficult situation is to change the situation. Make more money for example. If that is impossible you can, at least, change how you think about your misfortunes. And, try to keep those thoughts from reversing.