Headphones are plugged in but the computer is not recognising it

when i plug in my headphones in the headphones audio jack it doesnt recognise it as bieng plugged in and doesnt play sound but when i plug it into the microphone jack it recognises it but only takes the sound and doesnt play them