All writing is thinking. Regardless of the medium, the writer must inform himself completely. Inadequate thinking equates to bad writing. But asking lots and lots and lots of questions will lead to at least some very solid answers. Simply put, great thinking creates great writing.
But you must also trust in yourself. Often the most difficult thing, especially for the beginning screenwriter, is to trust and to discover that you have stories to tell – lots of them.