I get asked this so often that I made a little list of the things I think are most important. I cannot tell you how to come up with an interesting story. If you want to write for a living, you should already be bursting with them. But I can tell you a few things about good habits and practices. They are as follows.
1 - Write every day. A writer writes. He doesn't just talk about writing. He sits down and does it. I write four to six hours a day, six days a week - sometimes seven. Even if you only write for an hour, do it every day. And blogging doesn't count.
2 - Finish what you start. Don't start twenty different stories and give up halfway through all of them. Pick one and finish it. No one buys ideas. No one buys half-finished stories. They buy completed works.
3 - Show people what you've written, and LISTEN to their criticism. A writer only grows by getting feedback. Remember that, if you want to make a living as a writer, you must write to please an audience. If you show somebody a story and they don't get it, it's not their fault, it's yours. You didn't make your point clear enough. Try again.
4 - Read. Read the kind of stuff you want to write. If you want to write fantasy or science fiction novels you should read them. All kinds. Read other stuff too, different genres, different styles. Read lots of different books on how to write - not just one. They all have good advice, but it's best not to get trapped in one way of doing things. No one guy has all the answers. Especially not me.
5 - Send your work out - to agents, publishers, producers, and when they reject it, send it to somebody else. Everybody gets rejected. If you let it discourage you, you won't get anywhere. I have 3 produced screenplays. I have written more than 24. The means I wrote more than 21 screenplays that were rejected. You have to keep trying again. If the person who rejected your work gives you comments, LISTEN to them. They're not always right, and sometimes their reasons have nothing to do with how good your story is (for instance, "Sorry, we're already doing a horror movie about giant hamsters.") But if they make story comments, LISTEN!
6 - Network. This is a piece of advice I wish I had listened to years ago. Meet and get to know the people who buy the kind of work you want to sell. Make friends with them. When I came to Hollywood I thought that all I had to do was write and the work would sell itself. I was wrong. You must write, but if you want to make money at it, you have to learn how to sell it too. In this town that means getting to know agents and other writers and producers, and hanging out with them. I didn't do this. I locked myself in my room and wrote, and consequently I didn't know very many industry people to show my work to. A lot of my scripts never got a real chance because they were only seen by a few people.
There you go. My six suggestions. Good luck!