I hear this phrase and I do think it has merit, but people underestimate how contradictory and challenging it is for someone rational to act like everything is okay when it's not, especially if you're in an environment you have little control over.
Instead, I try to do two things.
First, echoing AllCatsAreGrey, I like the approach of being grateful or pleasantly happy about things that are actually good, despite how small and insignificant it may be. You won't feel like you're lying to yourself if the things are you concentrating on are actually nice. It could be momentary things like nice weather, current comfort at home, a cat you come across, the sound of a stream, a nice interaction with a worker, having a delicious meal, being at peace in general, etc. It sounds lame and hippy, but it's not meant to be a sudden magical cure, but moreso SLOWLY training to redirect your thoughts over time to something more helpful and progressive. Even if the negative stuff is more realistic and truthful in an intellectual sense, does dwelling on it actually help you get out of your situation or dig you further into it? In other words, does being "correct and realistic" actually help you objectively in the big picture? All you're doing is satiating your intellectual ego instead of moving forward. Also, this is not an all or nothing thing. I'm not saying you throw away all intellect because it's still needed. You just don't want to overdo it to the point of stagnating your life. It's about balance, but the ego is often too obsessed with being "correct and realistic" in the moment at the cost of being helpful in the longrun.
Secondly, I like the approach of removing the extra drama and negativity to life situations that don't require it. I notice that the ego really likes to amplify the drama in life in order to satiate itself. For example, people love making a person feel bad and submissive in a debate (you see it all the time on the internet) or adding extra anger and made-up assumptions to a person who cut you off in traffic. Sometimes our ego really likes to add more drama and emotion into a situation to satisfy itself when it's actually not necessary in the first place if you really think about. It only breeds more misery, not only for the people around you, but also for yourself, not matter how justified or "correct" you may be for doing so. My point is, evaluate how much emotion, drama, rumination, worst-case-scenario thinking you add to your life and be honest with yourself, is it actually necessary, or are you adding to it yourself after the fact? Evaluate how you interact with people, do you act in a way that adds more unnecessary hurt and emotion to them by how you react to them or yourself or are you able to stay calm and not add anything extra? Again, not a cure, but you will feel less burdened by your problems and find it easier to start working on yourself when you cut out this unnecessary "fat" from your actions and perception of the world that is weighing you down in your day-to-day interactions and thoughts. Bonus points is people will find you calm and dependable in emotional situations.
To combine these two. I suggest journaling. Write out your dark thoughts to evaluate them and diffuse any extra negativity that might influence your actions throughout the day. Also write out the nice things too, just so you can ground yourself and not overwhelm yourself when you feel like things are too bad.
Sorry for the rambling essay. I'm debating whether deleting this. Dunno why I felt compelled to write this all out on a random Saturday.