lay a ghost

lay a (or the) ghost

get rid of a distressing, frightening, or worrying memory or thought.
The image here is of exorcizing an unquiet or evil spirit.
See also: ghost, lay