You can either slow down your movements and work on getting rid of it, or you'll generally get better at avoiding it as you continue playing.
Practice slowly and you will build the right muscle memory. It's kind of like muting the string before you let go as opposed to just pulling off.
Got a tremolo by chance? Sometimes, the tremolo or even the nut will cause an overtone in your playing. You can fix either by putting some cotton balls around the trem springs or putting a hairband before or slightly after the nut.
I used to get that heaps bad when trying to play the intro to 'I Caught Fire' by The Used, so annoying... the 2 posts above this one pretty much cover it. Don't be disheartened, you'll get there. ^_^