how did the invention of the microscope help doctors to understand what caused diseases.

To help you, read about the discovery of "animalcules."

http://www.leben.us/index.php/component/content/article/59-volume-3-issue-4/236-antoni-van-leeuwenhoeks-amazing-little-animalcules