How do I replace a headphone jack

Solution
It would require very careful soldering that is best left to a pro unless you really know what you are doing. Sometimes, your case manufacturer may also sell replacement parts that will be able to replace all the front port jacks but you'd need to contact them.

For now, I'd recommend you purchase one of these https://www.amazon.co.uk/UGREEN-Headphone-Microphone-Raspberry-Ultrabook/dp/B01N905VOY/ref=sr_1_1_sspa?ie=UTF8&qid=1533139860&sr=8-1-spons&keywords=usb+to+3.5mm+jack&psc=1.
It would require very careful soldering that is best left to a pro unless you really know what you are doing. Sometimes, your case manufacturer may also sell replacement parts that will be able to replace all the front port jacks but you'd need to contact them.

For now, I'd recommend you purchase one of these https://www.amazon.co.uk/UGREEN-Headphone-Microphone-Raspberry-Ultrabook/dp/B01N905VOY/ref=sr_1_1_sspa?ie=UTF8&qid=1533139860&sr=8-1-spons&keywords=usb+to+3.5mm+jack&psc=1.
 
Solution
^what he says, requires soldering, job difficulty of which depends whether this is an AVR or a iPhone. If you are lucky the jack is on a daughter card and the whole card can be replaced.