If you can see a red light, the port is still live, cutting off the internal speakers.
The cause is a little leaf switch that is pushed over by the jack when you insert it. Sometimes these stick.
Try inserting and removing a jack a few (dozen) times.
If that doesn't free it you may attempt to tease it with a slim non-conducting tool (like a toothpick). Ensure the Mac is not only shut down, but unplugged if you try this.
And be careful; the leaf is fragile and it's an expensive bit to get to and replace, in fact on some models it's directly on the logic board.
If that doesn't seem to be the problem, some have had success by cleaning the red light with a Q-tip.