Well, it will depend on if the problem is the jack or the cord. If it is the charger cord, then you will just need to replace it. You may want to see if there is someone/somewhere you can borrow one from to see if it works fine on your device. If yes, then you just need to purchase a new charger cord.
If it is the jack, that is a bit more complicated.
First make sure your device isn't under warranty still. If it is, contact the manufacturer about the problem to have them repair or replace it. If it isn't under warranty, then either you, or someone you take it to, is going to have to at minimum replace the jack itself, or even possibly the motherboard.