Google: 2 steps for getting ranked in their search results
Recently in Google's blog there was a post that told how to get high rankings on their search engine results. So what is the secret? While they weren't really telling us anything we didn't already know, they did confirm a few very important things.
Of the 200+ factors that Google considers when ranking websites, the main factor mentioned in this article was inbound links. We already knew that inbound links were important but getting some confirmation on this never hurts. Inbound links alone aren't enough unless they are quality inbound links. Links from 'spammy' websites will not be counted and are basically useless.
But before you start trying to get inbound links you must optimize your site for the correct keywords. This is important because Google will not let you rank well for a keyword if they do not see that your site is relevant to that keyword. If you sell pet medications, Google will not let you rank well for the key phrase "celebrity gossip" if they don't see that content on your site.
So, according to this Google post, first you should optimize your site for your desired keywords, and then go for the inbound links from quality sources.