You can write an elegy three basic ways: about someone you knew personally, about a person you knew distantly or about a broad mournful theme. Identify which of these is your subject. Then free-write about it.
If you're writing about someone close to you, I'm sorry for your loss. Honor them with a unique and detailed description of your relationship. Recall specific times you spent together, conversations, gifts and occasions. How has your life improved because you were touched by this person? What will never be the same? How will you, your friends and your family carry on their memory?
If you're writing about an important figure you did not know personally, document how you came to know the person. What did they build, say, write, invent or otherwise create that affected you? Where were you when you first were struck by this person? How would your life be different without them? Collect quotes and other details that convey your point.
If you're writing about the idea of loss or a sensation of lament, bleed all of that out onto paper. Get your feelings out and be as specific as possible. Go off on tangents. Speak your mind in symbolic details. It is never enough to tell someone how you feel. Make them feel it. Put them in the picture with you. Your poem is a tool for communication, not simply personal purging.