The one thing I do is that I actually “tell” my right hip to tilt posteriorly rather than anteriorly like one is supposed to in a squat (squeeze the right glute, actually flatten the back a little on the right side). I’ve found that this keeps my right hip joint protected from whatever stresses cause the pinching movement I will get from the hips back cue. This is something that requires mind-muscle connection, so will take practice.
A quick way to achieve this is to think of doing the “humping” motion to set your hips before descending in the squat. But when the issue is just one side, it is not the optimal cue.
If you look, most (all the videos I see) people rotate their foot more on their dominant side when in the squat position (so usually the right foot is turned out more since most people are right handed). Imo, rotating the foot more places more stress on the hip joint, so right off the bat you have that when squatting. So I kind of disagree with people recommending rotating the foot out more. I don’t go full Kelly Starrett, but I think a straighter foot is better if one is worried about hip impingement.