The easiest way to get an idea is for someone else is to be responsible. Even writers work for someone else and many articles I've written have been because an editor called me up and said "I've got an idea that you might be interested in".
If you don't get handed an idea, where can you get one? You don't get it by staring into space and banging your head on the table. I know; I've tried. Ideas come from hunting them, by observing, or just letting them come. The trick is to leave yourself open to their arrival.
Okay, but where are they coming from? Everywhere. You can get them from the news or from observing people. Maybe a conversation with a friend sparks one. Maybe it comes from a vivid dream or a pleasant fantasy through up to pass the time during a boring meeting.
Then there's the more aggressive method of brainstorming. take out your notebook or a bad of paper, index cards, or blackboard and fill them with random thoughts, observations, phrases–anything you can think of. Group the ones that seem related together, draw lines between thoughts. Sooner or later, something should click That's why you carry a notebook around.
When all else fails, steal–but remember to call it "research". As Rudyard Kipling put it:
Now, I'm not advocating plagiarism, but I am saying that other people's works can be a goldmine of ideas. Homer did it. So did Shakespeare, Marlowe, Goethe, and just about everyone else. Not a lot of people know that Hamlet was a rewrite of an older story. Look at how The Seven Samurai became The Magnificent Seven and then Battle Beyond the Stars. It doesn't even have to be a rip off. George McDonald Fraser based his Flashman series on a character from Tom Brown's School Days. Rivka Galchen based her first novel Atmospheric Disturbances on the film Godzilla, though you'd never know it with its plot about a neurotic New York psychologist. Many stories have been based on a quotation. For my own part, I've written screenplays that were basically rewrites of films that I hated so much that I felt compelled to do something about it, though you'd never guess from the final product what the inspiration was.
When 'Omer smote 'is bloomin' lyre,
He'd 'eard men sing by land an' sea;
An' what he thought 'e might require,
'E went an' took–the same as me!
Wherever you get your ideas from, bear in mind that they are the starting point, not the end. Their purpose is to begin the process of writing. You may not recognise your idea when you finish your story. The idea might not even be there at all. We'd never know that there was any connection between acorns and oaks if oaks didn't sprout them.
That's the nature of creation.