This reminds me a lot of stoic philosophy. The book "The Obstacle is the Way" is a nice little primer on it. There's a story in there where a man is falsely imprisoned for decades. He spends that entire time learning law and is eventually able to argue for his release. I never verified how true the story was or how it might have been embellished, but even if it's a fake story, the point still resonates with me. You can either give up and accept your lot, or you can spend your time trying to work towards your goal. You can't change that you were falsely imprisoned, or born in a third-world country, or any other shitty situation in life. You can only choose what to do moving forward. (Sometimes actual mental illness can make this nearly impossible though).