When you have a good idea for a book or screenplay, but you do not know how to develop this idea on paper, what do you do?
There are some good 'from idea to finished book' guides out there. I recommend for example the 10th season of the Writing Excuses podcast, that is built like a master class and leads you through the steps of story-, characters-, and world-creation.
Writers Write just started an 'A novel in a year' class last week.
Hope that helps.
Write down your good idea. Put pen to paper. Get words on the page. When you have actually written something then you can develop it. If you are not sure what to do next ... sit and think about it. I think when driving or gardening -- times when I don't have to concentrate very hard on something else. Plots, twists in plots, character flaws, etc. often occur to me when I doing something else. However, most ideas for stories occur to me when I am actually writing. I start putting pen to paper and the words and ideas flow.
I would start by brainstorming the idea that you have. It is important to develop a complete alignment of your characters outlining their main features and roles in your story. Outline the development of your plot making sure high stakes are set your characters in order to have a strong conflict and resolution pattern.
The more I write, the more problems I discover in the story. I write two or three possible changes to the characters or plot to fix the problems. Then I pick the one that I like best. Sometimes there's only a minor change in the book, but occasionally things need to be seriously worked on. I've had characters that I needed to add in, delete, or completely change in order to fix a plot hole. I've had to change the sequence of events, add events or leave them out altogether.
But before I started actually writing things down, I had no idea of all of the tiny little kinks and problems that would come up. I didn't know there would be parts of the story I just plain didn't like. I didn't know any of that until I started doing it instead of just thinking about it.
Basically, the answer to your question is that the only way to figure out how to work things out is to do it and work it out as you go along.
There are lots of tools that can help with screenplays, such as WriterDuet.com. You can write screenplays with an editor like Word or Notepad, but this tool is easy because it familiarizes you with the ways real screenwriters do their job. It has fade and change camera position presets that automatically type in what you selected. As for books, I use Word 2016 from Microsoft. Just type (or write)! You can always use an outline, but when you skip it, a better story can come out because the imagination works all throughout the book, not just in the beginning.
John Truby has written and taught story structure for film, tv and novel for decades. His book is very accessible and deeply informative. He has software, audio recordings of his genre classes (thriller, detective, romance, horror, etc.). Buy the book. Read it. That's a heck of a start. Write following Truby's suggestion of figuring out who's the Main Character, what does she want? Who stands in her way perfectly able to compete over the Hero's desired outcome. Who are the minor characters? How do they interact? Read Truby. Do the chapter exercises. Write.