It would be useful to know a bit more about your setup but most people use good quality CLOSED BACK headphones to listen to the backing track whilst they record the vocal to a new track
This approach avoids the "spill" of the backing track in to the vocal track so the vocal remains "clean"
You may find that recording in this way uncovers "latency" - where you hear a bit of a delay between when you sing and hearing your voice back in the headphones but there are things we can help you with to overcome this
But first things first...
How are you currently recording - i.e. What device? (PC, Mac, Phone etc.), what software/daw? (garage band, audacity, reaper, cubase, sonar etc.) and what hardware? (Audio interface, microphone etc.)
Once we know this we can recommend the best approach with the setup you have