Read and follow the webmaster guidelines! It's that simple... however if you've already created a bunch of spammy links pointing to your site there might not be much you can do about it apart from hope you don't get picked up for it! I've heard of some people directing unnatural links to a 301 redirect so if they get penalised they just remove the redirect page... Not sure if that works though, interesting to see.