"if only's" are not only worthless; but, they are self-indulgent as well. At any point in time, you can only work with the information you have at hand; and it's amazing anything functions at all, considering how little of it we have at any given moment.
If I knew then what I know now, I'd have won the powerball at least 10 times or so. So, it's not just stupid to think like that, it's self-absorbed and harmful to yourself and possibly those around you.
I think we all probably think like that from time to time; and it can be harmless to look back from time to time. But, the past is not a good place to take up permanent residence.
I can't think of a suitable replacement for, "if only," thinking; but, as a quick stab at it, I'd say, focus on, 'who, what, where, why, or how.' Focus on now. The past is always changing, with every moment that passes, the past morphs and changes. We can forget things, receive new information, etc... etc.. And the future, I'd like to believe, is always in a perpetual state of flux.
You can live right now, in the past. You can live right now in the future. Or you can live right now, in the now. I think any one of those places is fine; but, they are all in the now, right now. And they are all, always changing, always in flux, and none of it is permanent.
Easy words to say... I know.