Try to find a doc or other professional that has experience with lifters or athletes. If you can't, that doesn't mean the doc can't help it just reduces the chances of quality care in that regard.
Once you know what's wrong after seeing a doc, figure out ways to traing around it. Emphasize doing things that will prevent it from happening again.
If it's not contra-indicated, you can still build your squat using front squats, SSB squats, and zercher squats. Do more deadlifts and DL variations and zercher GMs to keep your P-chain and hip hinge strong. Glute ham raises and leg curl variations can bring your hams up.
If overheads are okay, then great! You'll also want to beef up your triceps and lats to help take some stress off the shoulder. Dips can be good if they don't kill your shoulder.
When you can back squat again, you might have to start taking a wider grip. I know it's harder, but who cares about an extra 5-10lbs on that single lift if it gets you hurt again. And it'll be a good excuse to get your upper back stronger which will help with the other two lifts anyway.
Ease back into movements that you couldn't do before as you get better. It'll be better to take it slow than to add everything back in at full intensity and just get hurt again.