Rpi 3B+ 3.5mm jack burnned

As you can see the picture, 3.5mm jack changed color. Im at the first use of octoprint, without printer I just surfed octoprint setup page. after a while, with metal smell, jack has burnned. (without fire, just changed color with smell)
I worry about fire when using with printer..

Why this happen? Can I prevent this?

I have never seen that before.
First of all - if you still have warranty use it.

If you don't have warranty anymore I would suggest you desolder the headphone jack.
It's used for RCA and anolog audio, which you shouldn't need on your printer :wink:
You could use snippers to snip it off and desolder what's left.