Membrane sweep??

FTM here and I’m confused on membrane sweeps. What is the point of this and under what conditions is it done? Can anyone ask for it or is it only for special circumstances? How far along do you have to be for doctors to do it? I’ve just never heard of this until recently!