The same way you would write a story:
Come up with a Premise (Plot)
Decide on a Setting (Place, Time)
Make sure that the game's Setting has an interesting Backstory to it (History)
Create major and minor Characters (Hero, Party, NPCs)
Brainstorm for new Ideas (Its okay to use Ideas from other games, but be sure to credit the origonal creators)
Stick to these, and you'll have a good story in no time.