I have found the first step to diagnose pistol issues, is have someone else shoot it and see if the same thing happens to them.
Nine times out of 10 it is some bad habit I have picked up. Grip deviation, trigger finger, yes even "limp wristing"

Sometimes just having another "knowledgeable" shooter watch you shoot can diagnose issues as well.
A few years ago, I was shooting my XD, 40 cal. I had already out hundreds of rounds through it with very consistent hits.
All of a sudden, this trip, I was hitting low left, with great groups, but still a couple inches low and an inch left.
I was getting pretty mad! I had my buddy shoot it, and he sprayed all over, consistently, like his usual,

.
I convinced myself I need a new Powder River Trigger "great trigger!" installed the new trigger, went to the range. The new trigger has an awesome crisp break and a much better reset.
My groups were substantially tighter, beautiful groups, two inches low and an inch left,

I had a buddy who still shoots competitively, watch me shoot. After just a couple shots, he says " you are slapping that pretty new trigger, like it was a red headed step child"

Once corrected, I was back to hitting center with good groups.