Literary analysis is a type of writing in which you analyze a story. You try to tell the meaning of the story.
The first thing to do in writing a literary analysis is to identify the writer's purpose. For example, the book Robin Hood is meant to tell people about the abuses of power that usually happen in a society, like the rich stealing from the poor (hmm, I wonder if that's still happening today…).
The second thing to do is think of the characters, plot, imagery, etc., as tools so that the reader can get what the writer wants to tell. In the book Twenty Thousand Leagues Under the Sea, Jules Verne contrasts Pierre and Captain Nemo. Even though they both are interested in science, Pierre is satisfied with sacrificing his freedom to continue his researches, but Captain Nemo would not want to sacrifice his freedom to learn more.
The third thing to do is ask yourself why the writer used these literary devices in these ways. Well, the original writer(s) of Robin Hood lived in the Middle Ages, when the imagery used to portray the actions of Robin made sense to the audience.