There are a bunch of ways to get rid of ghosts, but you have to get rid of ghosts before they scare you to death!!
1. Take their gravestone and drop it off at the cemetery.
If they don't have a gravestone. Then take the ghost to the cemetery by clicking of your car and clicking go to community lot with.. then click the ghost's name. Then jog to your house with your car in your inventory. You now are ghost free:)
You will need to download the Sims 3 Nude Patch to remove the blur.
You can't
go to the graveyard after dark, you have to catch the actual ghosts(the ones that are like transparent sims, not the spirits that look like halloween ghosts)
Put them in your yard and every now and then they will come out.
To get rid of a robot on Sims 3, you must first go up to the robot and argue with it a lot. Then once you've fought with it enough, it eventually flat out hates yu and leaves.