You can't write a good compare and contrast essay without first reading what you've been assigned! Moreover, to generate a good essay you've got to read them carefully. It would probably help you to make notes (mental or, better yet, physical ones) as you read, marking things you consider important. This kind of pre-writing work can give you a serious head-start on your actual essay when you sit down to do it.
Once you've read everything you have to, draw up lists of how those works are similar and different to each other. This is when those notes you might've taken back in step one could come in handy. Depending on how organized your thoughts are, you might just jot out a few main ideas on a blank sheet of paper/computer screen or you might actually want to make up an actual list with columns for things the texts share and things they don't. During this phase, just write down whatever comes to mind, no matter how miniscule you think it may be.
Once you're satisfied with your lists, you can go back through and cherry-pick the points you feel are most importantly similar and different. Here you should be looking for the things that you think will lead to the most compelling essay you can write. Pick out elements, for instance, that are central to the identity of both works. Consider their major themes, main characters and the messages of each - it's likely one of these things will provide the basis for your essay. If, for instance, both texts have the same basic theme, you could write a paper about the similar and difference ways they explore that theme.
Your outline will break down the flow of your essay, noting only the main points you want to cover. For compare and contrast papers, probably the most basic form the essay could take would be six paragraphs in length. You'll start with an introduction that lays out the general idea behind your argument; it will take a form similar to 'I think the way these texts compare and contrast these elements is important because….' Then you'll take on the body of your essay, which will be four paragraphs long. You could split them up into two paragraphs on each text (one for comparing and one for contrasting) or two paragraphs that compare both works and two that hold all the contrast. Or you might find a hybrid of those two ideas works best - you'll want to go with whatever you think does the best service to your paper. Finally, you'll add a concluding paragraph that sums up your argument and restates, perhaps in a new way, why you feel that what you talked about is important both to your texts and to the world at large.
Once you've got your outline set, writing the essay mostly becomes a matter of supporting your points with evidence from the works you read. This is key to getting your audience (your teacher at least) to accept your arguments. For compare and contrast papers, which have a little more ground to cover than regular essays, you can probably get away with having one killer example per text for each point you want to make. Depending on the depth of your assignment, you might also consider bringing in outside criticism to back up your points. If that's required or recommended, though, your teacher will probably let you know.
When you think your essay's done, make sure you give it one more pass, checking for errors in both content (faulty arguments) and form (bad grammar, spelling, etc.). No doubt your teacher will be grading you on completeness, and an essay doesn't exactly seem done if it's riddled with errors. It might be especially helpful to get a second set of eyes; you could ask your parents, peers or even a TA (in a college course) to take a look at your arguments and make sure they stand up to scrutiny. After that, congratulations! You've got a compare and contrast essay on your hands. Was that so bad?