It's easiest if you have a rudimentary concept of the story line. Most of the time I begin with this simple concept and built.
Years ago, I wrote a sci fi thriller. I wrote it free-hand, and it's not likely to move from the closet where I left it, waiting to pay a typist to type it, but it was a decent enough story.
It started with a simple concept. When they first began toying with virtual reality, I came up with an idea. An international arms group wanted to take advantage of weaponized virtual reality, used in torture, to perfect to sell to the highest bidders. In essence the thought was they could break down the most hardened soldiers/spies through making it impossible for the prisoner to distinguish reality from virtual reality. In essense, a man thinking he was actually in hell would tell you anything to get out.
But it starts as a seed, and then you have to add questions. Who would they get to experiment on? "Transients with no background."
Well, they'd use them up, leaving them virtual vegetables, and dump them back on the streets. They have no signs of trauma, or infections, presumed to be drug addicts that fried their brains.
So, you have a bad guy, this evil weapons syndicate. You have victims. Now, you have to make a reason why someone would care about these vegetables found on the streets. Obviously, the old, "They abducted someone that mattered." is the handiest excuse to begin investigating, "What's happening here?"
Start with the seed idea, ponder it. Build on it.
And strangely, I used a nurse and another employee in a nursing home as the protagonists, two people not happy with the over abundance of new alzheimers patients who can't remember their names. But they learn they can re-teach them, and this triggers the notions, "They aren't alzheimers patients. Their memories were simply erased. Administration who doesn't care what a nurse thinks? Pisses her off. She and this guy decide to solve the mystery. (Budding romance added to the story).
People get sucked in over their heads. They plant someone hoping to get him abducted to trace him, and lose him. Things get nasty, they can't go to the authorities, they turn to a friend from a wacko paramilitary group, who is gung ho, and now you have all kinds of stuff happening.
But it started with thoughts on virtual reality, and what it might be used for.