This is a large question, as the above posts indicate. I'd recommend looking at the process in two basic steps to get started.
First, make sure you understand the surface of the text. If it is a story, you should understand what happens in the story; understand the plot, the basics of character and setting. If it is a poem, you should understand what the poem is about; understand the subject and the basics of perspective and tone.
Second, look beyond the surface. Here, you begin to look at structure, form, use of metaphor, other types of figurative language, etc.
After this, you might explore how the first step and second step of analysis relate to one another. How does a metaphor relate to a character? How can one character's relationship to another be seen as a metaphor for a text's larger themes and meaning?