Then you very likely either have a wonky jack on your computer or a short in the line between the headphone plug and the headphones.
The computer side could be anything from dirt to the jack having developed cracks in the solder where it connects to the motherboard. Headphones are notorious for developing issues somewhere between where they connect to the computer and where the tiny speakers are that deliver sound.
You're now in a situation where detective mode is necessary. Try the headphones on some other device and see how they work. Try other headphones or a set of external speakers on the computer and see if they work. One of the two should likely not work correctly, telling you on which side of the equation the problem lies.
Brian AKA Bri the Tech Guy (my website address is in my profile) Windows 10 Home, 64-bit, Version 1709, Build 16299
Here is a test to find out whether your mission in life is complete. If you’re alive, it isn’t.
~ Lauren Bacall