Many languages use a certain type of grammatical expression called a contrafactual condition (a.k.a. contrary to fact, counterfactual, or CTF) to describe what would have been or would be, if only something had or hadn't happened. There are various types of CTFs. Some focus on a thing that didn't happen yesterday that would have made a difference today. Others point out what would have happened five years ago if something else had not happened five years before that.
One category for describing CTFs is as "upward" or "downward." Upward CTFs typically reflect on how things would have turned out better: regretting poor decisions, obsessing on a mistake, or simply focusing on how much a single past event changed everything for the worse. "If I had moved to take that other job, I wouldn't be looking for work now" and "Life would have been better if I had been healthier last year" are examples of upward CTFs. They look upward: at how things would have been better ("looking up") in other circumstances. Downward CTFs are the opposite. They express relief, celebrate a good choice, or concentrate on what has made things better. "I wouldn't have been happy in my old neighborhood if I'd stayed in the first apartment," and "If I had quit that class, I would've graduated after the lockdowns, and I'm so glad that didn't happen!" are downward CTFs.
Whether we know it or not, CTFs are a big part of our lives every day. We use them to make decisions, determine cause and effect, play games, and do math problems. CTF thinking about the past, present, and the future influences us.
Several studies in recent years have more clearly demonstrated the impact of CTF thinking. In general, people who spend more time in downward CTF thought patterns seem to be healthier and happier than people who habitually practice upward CTF thinking. In fact, upward CTF thinking more often leads to depression.
The connection is sensible enough. If you spend time focusing on how things would have been or would be better, especially if you dwell on regrets and mistakes, those events will overshadow everything else. It's not wrong to think about the past and alternative outcomes; remember that CTF thinking can be motivational and logical, helping you to move forward in healthy, necessary ways. Still, where and how we focus our attention counts — and that's something worth remembering, too.