when recording, am unable to have voice only on the recorded track. Cannot eliminate the music

When I try to record a song, the music is being picked up by the microphone. I have tried using a headphone, no sound from the speakers at all, but the recorded track is still picking up the music.

If you are overdubbing, you need to make sure Audacity is recording from the microphone or microphone system and not Stereo Mix or What-U-Hear or other fake device. This may appear a little wacky, but that alternate setup is the one you use to record music from YouTube or other on-line service. Billions of people try to shift from recording on-line content to overdubbing their own voice and not change the recording settings. They get exactly what you have.

If you’re using a sound mixer, there are ways to mess those settings up and get the same thing depending on the mixer. But if you have a simple microphone, make sure you’re recording from it and nothing else.