For example, a writer may choose a subject of war for his story, and the theme may be his personal opinion that war is a curse for humanity. Usually, it is up to the readers to explore the theme of a literary work by analyzing characters, plot, and other literary devices.
hope this helps :)