Well, civilians are a timid bunch, they interrupt their tasks and run in fear at the sight of zombies, goblins, random harmless wild animals, you name it. You can handle this by keeping them safely separated from anything threatening - keeping them indoors, with your only entrance accessible only by a drawbridge, is the simplest solution. If anything gets inside, sick your military on it before it can disrupt your civilians too much. Letting any civilian outside the fortress onto the surface is risky, his chances aren't good if a siege/ambush shows up.. you may be forced to close the drawbridge and leave any civilians on the surface to die. So, try to keep them indoors as much as possible - burrows/alerts are very effective for this, although a bit of a pain to set up.
If zombies get inside your fort and keep rising again, it gets a little trickier. You want to make a garbage chute, a tall shaft with an inaccessible room at the bottom (wall it off after you dig it out) and a hatch on top, designate the hatch and a few tiles surrounding it as a garbage dump. Then have your military kill any zombies that make it inside, and immediately flag the corpse for dumping, hopefully your civilians get it to the garbage chute before it rises again. But continually rising zombies inside your fort should only happen if you're in an evil biome (not recommended for new players), or somehow the necromancer sneaks inside - post a guard dog at your entrance to prevent this from happening. Again, the critical thing is keeping your civilians safely inside the fort and the necromancers/zombies/goblins/etc. safely outside, with a well guarded entrance between them.