I have a drop down called subject, I have 3 options in that drop down. How can I preselect the the option based on template or URL or any other thing so that author does not have to choose that option.
For your requirement, with logic for pre-selecting the Granite UI dropdown, you can create a client-library with JS logic; with the category as cq.authoring.editor.hook. This when the client library is invoked, the custom JS logic will detect the template of the current page and will pre-select the drop-down options accordingly, but the logic will run only when the current drop-down value has NOT been set.
Making sure your client library have correctly set categories and dependencies: