I don’t know how someone else gets ideas for stories. I’ll guess that something triggers an idea that ‘something’ is a good story. In my case, there is a trigger. It’s not always the same. As an example, I may read an article about Fuel cells, and that becomes a cascade of linked ideas, such as a fuel cell made of paper ( don’t laugh it’s actually been done) which grows to what about making a paper airplane with whose kind o fuel cells, which goes to why not a regular plane, or a dirigible which uses humidity in the air to power the paper fuel cells in the skin of the craft. Which then goes to what’s the pilot and crew like, what is the world like that has this blend of technology?
Another way an idea seems to form, again in my case, is a story by another author. How would I write that story? What would I change, would the direction of that story actually work in my story. A lot of stories are built upon things we have read, or seen, or even heard being discussed. As another example. The current political furor in the US over Donald Trump and Hilary Clinton. That could easily be turned into a monstrous conspiracy theory about the status quo being pushed to the wall by a non-traditional candidate, and one that represents all the vile truths about the established political system. Or, to reverse it, a vile candidate who’s only strength is a cult of personality reminiscent of a pattern in recent history, versus, a flawed but well-meaning member of the establishment who is trying to effect change from within the existing system.
In all of this, the idea is to extrapolate, to expand upon what the writer sees, hears, and feels. Kids do it all the time, so one could say a writer might be a child that never grew out of ‘what if’.