Given the phenomal success of "The Martian," Andy Weir is in a position to know what works and what doesn't! This is good advice:
1) You have to actually write. Daydreaming about the book you’re going to write someday isn’t writing. It’s daydreaming. Open your word processor and start writing.
2) Resist the urge to tell friends and family your story. I know it’s hard because you want to talk about it and they’re (sometimes) interested in hearing about it. But it satisfies your need for an audience, which diminishes your motivation to actually write it. Make a rule: The only way for anyone to ever hear about your stories is to read them.
3) This is the best time in history to self-publish. There’s no old-boy network between you and your readers. You can self-publish an ebook to major distributors (Amazon, Barnes and Noble, etc.) without any financial risk on your part.
The author of The Martian offers three critical steps for new writers - Quartz