What is broken? Is the fitting broken off of the extruder? It looks like that is not the stock extruder and the previous owner added the nut so they could use a PC6 fitting instead of the stock M8 compression fitting. It also looks like there's a tension adjustment for the filament which is not stock either.
From what I can see, it doesn't seem like anything is broken and that fitting should thread into the nut glued in. The stock arrangement was an m8 threaded compression fitting screwed directly into the extruder piece.
If this is to remove the stuck filament, best bet will be to remove the extruder completely from the z-axis carriage. You can follow these instructions here which should work for the extruder you have: https://www.help.prusa3d.com/en/guide/how-to-access-and-clean-the-extruder-pulley-mini_126457
So i got my first 3d printer a few days ago , but tonight the filament got stuck and i had to disaseble it.
The first nut was glued on , so i guess the previous owner made a quick fix.
Honestly i really regret getting a printer second hand now , but i post here to ask for possible solutions.
Just for reference, what printer is it? It looks like a Prusa mini clone with a Bondtech extruder?
I think the nut you refer to is a push-fit fitting. To fix it, it looks like you will need to glue it back in to the extruder. Otherwise, replace the extruder.