How can I fix this kind of bent earphone jack? It still works if I constantly push it in, but it won't work if I don't push it, because it doesn't really fit inside anymore...
You get a pair of pliers and slowly and carefully bend it back straight. You then put the pliers down, grasp the plug in two hands and try to pull it apart with your fingers (try to break it using the same forces it will be subject to in-service). Pull at least twice as hard as you'd pull to get the plug out of the socket
At this point one of two things will be the case:
The internals of the plug are secure and aligned enough that they work. You aren't able to pull them apart; it'll be fine until you can get around to replacing it.
The internals of the plug are weakened or break off while you're bending it back or pull testing it - it was a goner anyway and now you can definitely know you need to replace it (and you don't have to pick it out of the socket of the phone :) )
ps; quick note on terminology here: strictly speaking the jack is the socket into which the plug goes but people do variably use jack to mean either side of this (jack being a contraction of jack plug), so I've deliberately used plug and socket for clarity