When you’re not writing what you know, you should at least be knowing what you write. And in this era, there is no excuse to skip this step. For basic facts (“how many lightyears to Barnard’s Star?”), the information you need is literally at your fingertips. For more complicated questions (“what does it feel like to to walk in higher gravity?”) you’ll have to get creative in your searching. Luckily, there are some great tools for that.
Quora – you can go there to ask questions of all sorts, or search for questions that may have already been answered.
The NaNoWriMo Reference Desk – like Quora, you can ask questions of the second sort, the kind google won’t help you with. It is geared for writers, and being associated with National Novel Writing Month, it is most active in the month of November.
Talk to people. Do you know any relevant professionals, people who have lived in a location featured in your book, people of other genders, ethnicities, sexualities, etc?
Read books. Fiction and nonfiction are both useful, but be careful. You can easily get into a “copy of a copy” situation if you don’t cross reference facts and tropes.
TV Tropes – Yes, I went there. And stayed too long. TV Tropes is a good resource if you want to compare how other writers approach a subject. You can find facts in the “useful notes” pages, too.
Finally, google. Nothing is too small to google. Here are some examples of things I’ve googled in the last couple days, all for the sake of writing: