It's been said again and again over the years - science fiction is a difficult genre to do right, thanks to the breadth of knowledge it demands from struggling creators. Otherwise, as David Gerrold suggested in The World of Star Trek, you've just got science fantasy. Admittedly, that does have a strong appeal, perhaps for similar reasons that the standard fantasy genre has enjoyed such enduring popularity... but I'm not going to get into that today.
The biggest problem with avoiding that science fantasy status, assuming at the outset that you're trying to avoid it, is that in space our experiences betray us. A lot of what we know just isn't so out there, because things work differently on a planet and in vacuum. Not that I'm talking about space being magic - it's more the casual assumptions we make so often that it takes a special effort to recognize them and look past them.
Like, say, if you're far enough away from something, that thing can't see you. Correct on Earth, but not nearly so in space - where the only horizon is billions of light-years away, a time-delayed shadowplay of the creation of the universe. It may be that we naturally assume it's easy to hide in space because it's so easy to hide at night - but just because one is a reflection of the other, they don't have all that much in common. But it's tempting to overlay familiar things onto the void anyway, without consciously thinking about what works and what doesn't.
Take, say, space pirates. A staple of the genre going back decades - ruffians for the square-jawed Interstellar Patrol to bring to heel, marauders who stand to take away everything our crew of intrepid space merchants holds dear - because they're easy villains easily understood by the audience, a transposition of Earth onto the stars. But the model that's so frequently used, that of space pirates shrieking in out of nowhere to fall upon a rich cargo, plunder the craft and disappear with the booty in their hidden base, doesn't work. All it would take is one person looking through a telescope in the right direction... and a spacefaring society wouldn't be conducting skywatches with just one person looking through a telescope. Nor could they shriek in out of nowhere; unless they have a point-to-point FTL, which brings up a raft of its own problems for organized societies, the target ship would see them coming from quite a long way off. Nor would they be able to hide; the anomalous heat signature generated by a pirate base would be easily detectable by a patrol.
Sure, there are ways around it if you think through the implications, but they do restrict the author's freedom - or, more appropriately, they act as a reminder that you can't just make "Earth in Space" if you want anything more than a tincture of believability.
I was talking through this recently to a friend who's participating in NaNoWriMo and who is reckoning with space pirates. During the course of the talk, I hit upon a concept I've never seen used before; pirates operating out of a hot Jupiter.
Hot Jupiters are something that science fiction never really thought of in a big way, but since the first one was discovered orbiting 51 Pegasi in 1995, they've upended our understanding of how solar systems can be built. They're gas giants that can orbit their parent star well closer than Mercury orbits Sol, and as a result they're superheated and volatile. The scientific interest alone is undeniable, assuming you have the ability to get there - preferably through an "only works at specific locations" FTL like the Alderson drive, at least in my books. What I figured is that these hot Jupiters could also provide space pirates with new Spanish Mains.
There's an important assumption here, first: that starships can refuel themselves with hydrogen, or other gases present in gas giant atmospheres, and that they are capable of entering them in order to collect them. If that's the case, space pirates don't need to be space pirates at all, technically speaking; they can be air pirates, striking at starships as they descend into the atmosphere to refuel. Inside the atmosphere, there is a horizon and stealth is possible. They could operate from aerostat habitats in a relatively calm portion of the atmosphere, if such a thing exists, and limit their attacks; in that way, a ship's disappearance could easily be put down to violent weather conditions.
Sure, it's not limited to hot Jupiters - you could probably do it as easily with a regular gas giant. But the point is that this thinking, this walking through the situation and looking around at the possibilities that the situation implies - rather than making things work the same way they work back home, and that's that - is where good stories come from.