Fear not. I shall tell thee how one doth write a commentary (for homework purposes only- where there's no time limit).
1.Read the given piece. What's the pace? What is the piece about overall? What's the format of the piece?
2.Annotate baby! Whatever ideas you have, let them spew out of your mind. Even if it sounds a bit weird, just list keywords and short sentences. What connotations do certain words carry (positive or negative?). Is the author's tone changing?
3.Hunt down those literary devices. Identify what's their point in the written piece. Does it add rhyme or give a continuous flow in reading? Is it to provide greater detail (identify the form of imagery)?
4.Note down the punctuation (more important in poetry than plain ole' text from a novel/play).
5. Start writing!
This is how I usually set out my commentaries:
- Introduction (author's name, the given piece's title, the overall context of the piece, list some literary devices used, the tone of the piece)
- Body (if it's poetry, then I usually do one paragraph for each verse. If it's prose, then each point with it's evidence [a quote from the piece] and affect on reader in a paragraph on its own)
- Conclusion (state the tone at the ends of the piece, the reader's reactions, summarise what happened in the piece, i.e: someone died, a man cried, etc...)
There is no 'perfect formula' for writing a commentary. There are many ways to go about. You can write it sequentially (start from the beginning of the piece til the end). Or you can write it in themed paragraphs (i.e: paragraph one discusses literary devices, paragraph two is about the author's perspective, tone and mood, paragraph three details certain examples of imagery and its affect on the reader, etc...). However, you must remember to be clear and eloquent in your writing, and must remember to explain the affect on the reader. A commentary is not a rewrite, it's an explanation and discussion of the thoughts and language in the written piece.
Here is a much lengthier Wikibook guide on writing a commentary (an excellent resource, no doubt).