To be completely obvious, it seems the best way to avoid regret is to know you are female-identified, i.e., not that you associate with, long to be, are part this/part that, etc, but to know.
Several of my post-op friends were (and are) firm on that point, but were ambivalent for a variety of reasons on SRS. None of them regret it in the least, and ALL of them describe it as transformative psychologically as well as physically. In this way, it's confirming surgery not in the sense of resolving doubt, but in confirming and building what is already there.
Of the two people I know best who have had problems, the first (who almost died) has no regrets. The second, who has some moderate, ongoing problems, has experienced the confirmation but wonders in retrospect if the ongoing pain was worth it.
So separate the issues: regret because it was a mistake to begin with, or disliking the burdens SRS can bring. The first is rare, the second is common but seldom rises to the level of actual regret - where one wishes they had not done it. The difference is really important, because anti-trans people like to focus on people's issues (not regrets, though that's how they try to spin it) as evidence that SRS is wrong. A better comparison is natal women who go through terrible menstrual cycles ... they may complain, it may burden their lives, but they don't regret being women, and they don't usually pursue hysterectomies to solve the problem, either.