Keep them away from sapient corpses. Seeing the corpses of anything that can think, dwarf, goblin, troglodyte it doesn't matter will cause significant stress. Stress that will be linked to traumatic memories which will reoccur and create more stress. Also witnessing the death of a sapient can cause even worse thoughts in addition to seeing the fresh corpse. Stress from death and corpses is severe, reoccurring and cumulative, avoid it as much as possible.
Limit how much violence your dwarves can see. Dispose of corpses quickly, burying citizens and destroying everything else. Have only your most hardened and/or emotionally stable dwarves haul and dump such corpses, they'll make good candidates for your military as well.
If you need to dispose of prisoners do so in a way that it out of sight of your dwarves and destroys the body. I've been throwing mine into a small but deep fire pit covered with floor hatches. The hatches prevent the dwarves seeing the prisoners die in the fire but you could just as easily use magma or an atom smasher.
Eventually, if you can get your dwarves through the stress of exposure they will develop a tolerance for it. Military training has been said to speed this process but I can't personally confirm.
Edit: Oh also if you're literally just looking for a way to remove stress Dfhack has the command "remove-stress" which will do the job for an individual dwarf.