My 3.5mm headphone plug is bent, ever so slightly, so that it slides out of the jack on my phone.
The stereo functioning is still fine.
How can I straighten it?
3.5mm connectors are fragile. They're frequently abused. They won't last forever. Every action you perform on it may weaken the structural integrity. As Ian said in the comments, the chances of you making it worse are quite high.
If you really have to fix it:
Grab two thin pliers, put one one the midsection and one on the tip. Now bend, very carefully.
If you break it, you'll need a soldering iron and a new connector. The connector is cheap, but it's not worth getting a soldering iron if this is the only thing you want to do with it.
If you want to replace it. Simply cut the original plug off. You can buy replacement pieces any electronics store. You need a 1/8 inch or a 1/4 inch stereo headphone plug depending on your application. On the plug there are 3 connections that are separated by plastic insulators.
The tip or center connection is for the left, the longer (ring) is for the right, the elongated metal piece with 2 little wings is the ground. Those little wings you gently bend around cable with just enough pressure to hold it in place firmly.
With a knife remove about a 1/2 inch of the plastic insulation from the headphone cable . You will then see 3 colored wires -black, red, and white. On the small wires remove about 1/8 inch of the insulation. Use a small soldering iron to join the wires to the connectors.
Black= ground , Red = left, White =right (if memory serves me right) . If it sounds odd afterwards reverse the left and right connections.
I forget to mention there are 2 types of plugs. Male and Female plugs- the reason for this should be obvious. The one on the headphones are the male plug type.