The two basic methods is to either use phase cancellation, where you take the instrumental, reverse the polarity and stereo separate it from the original song. The waves that are identical between the instrumental and original will cancel each other out, since the phase is reversed. The remaining waves are the vocals. Not a super clean result, but with good eq and compression you can get quite far. Second method is Izotope RX, which kinda does all this automatically, with some AI algorithms. Pretty clean result, but will still not be perfect.