You can always encourage spirits to move into the light so they can move on. Sometimes that is all it takes. Just a few words encouraging them to move into the light. However if your going to work with spirits always do it with a sincere and positive frame of mind and always pray a prayer of protection before you start and when you finish.
Some spirits are trapped at a location however. They don't seem to be able to move on.
Saint Michael the Archangel,
defend us in battle;
be our protection against the wickedness and snares of the devil.
May God rebuke him, we humbly pray:
and do thou, O Prince of the heavenly host,
by the power of God,
thrust into hell Satan and all the evil spirits
who prowl about the world seeking the ruin of souls.
Be sincere when you pray the prayer and it will protect you.