That's easy, write a great book and get discovered! While accomplishing that is very complicated, the answer to the question really is that simple. So how do we achieve this? Well, relax. Great books don't start out that way. Like all things in life, it takes work to get them to the stage where they are publishable. Don't be afraid to write a rough first draft. You will be revising, a lot, so save that part for later. Get the words on paper or into a computer.
Once you've finished then you can go back and start making it great. Don't expect to do it in the second draft either. You'd better really love this book because you'll likely end up re-writing it so many times you'll lose count. I felt like my novel started out great and I've still re-written it so many times I've lost count! Don't get discouraged by the revision process. Uncovering a diamond takes time and hard work.
As for getting discovered, I've talked a lot about queries and conferences in past posts, check them out. For an absolute treasure trove of info on getting published check out this outstanding post from Jane Friedman at Writer's Digest: http://blog.writersdigest.com/norules/2009/10/06/TheSecretsToPublishingSuccessJanes2009ToughLoveGuide.aspx
And if you have doubts about what Twitter can do for your writing career check this out to see what other writers have said about it: http://blog.writersdigest.com/norules/2009/10/04/HowTwitterIsHelpfulForAspiringWriters.aspx