As a first step, make sure the cable you already have isn't loose at either end.
However, your monitor cable is most likely broken inside (assuming you are using an old VGA cable,).
Hopefully your monitor isn't one of the ones where the cable goes straight into the monitor (no connector to take the cable off), if it is, you can't replace the cable and you will probably need a new monitor soon.
Otherwise you simply need a new VGA cable like this:
http/www.newegg.com/Product/Product.aspx?Item=N82E16812270348
Make sure both ends of your cable look like that, the site I linked is a good source for computer parts, but you can use amazon or any other website. There's nothing really special about the one I linked, as long as it is the same type of connector (VGA).
You can also check any old monitors you may have laying around, to find one of these cables; or ask somebody who does computer stuff (I have an extra one of these cables in plain sight, and could probably find 2-3 more in my house).