Ghosts are real although I have never experienced one. I have heard several stories from relatives which make me believe the existence of ghosts. I just realised, the more you conceive or think about bad things like ghosts, you'll start having hallucinations about them haunting you which doesn't occur in real life. Also, watching movies, specially horror can give us false imaginations on ghosts. I therefore think we should erase thoughts of ghosts from our minds in order to have a peaceful mind.
But then, in certain circumstances, we cannot avoid such thoughts especially after experiencing them. In this situation, the only way out is believing in the power of prayers. Also, you can share this with someone who can help you get off it.