Emergency situations are stressful, but handling and engine failure can be as simple as "A, B, C, D, E."
A - Airspeed
You can fly a plane without a lot of things, but airspeed isn't one of them. When things go wrong in the cockpit, pitch and trim for your best glide speed. After all, no one ever complained about having too much glide distance when their engine quit.
B - Best place to land
Is there an airport within gliding distance? If not, what's your next best place to land? Consider roads and fields. If the roads are quiet and don't have power lines, that's probably a good idea. If the fields look smooth and free of things that would flip your plane over, that could be your best option. Begin flying towards your intended point of landing.
C - Checklist
Run your checklist slowly, making sure you complete every step. Rushing your checklist can make situations much worse than they need to be.
Too close to the ground for a checklist? Focus on flying the plane all the way to the ground.
D - Declare emergency
Once your checklist is done, let ATC know what's going on. (Remember "aviate, navigate, communicate"?). SQUAWK 7700 on your transponder to quickly gain the attention of air traffic controllers. ATC can get emergency service to you, but they can't climb into your plane and fly it for you, so make sure you have your plane under control before you start talking.
E - Execute emergency landing
Make sure you and your passengers are buckled in tightly before touchdown, and that you're ready to egress the plane after you come to a complete stop.
Stay calm, follow your procedures, and never stop flying the plane. Do all three, and you'll set yourself up for a good power-off landing.