Now the psychoanalytic school of psychology has explained why people dream, and can explain what inspiration dreams bring to people. Speaking of which, this is a very big and deep topic. If you are interested, I will recommend you to buy Zhu Jianjun's books. This book gives a detailed introduction to how to interpret dreams.
I'll explain your dream about ghosts. When we dream of ghosts, I usually use images to express my emotions in the dream, because there are many conscious images in our brains, and dreams use these images to tell us what they want to tell us. Because I don't know what the ghost you dreamed here is, I can't tell you what emotions you are expressing.
But the dream gives me the feeling that you are out of such an emotional state because it says that you have a way to kill the ghost. But dreams also tell you that ghosts cannot be killed. This also tells you that the mood will come again, but you already know how to deal with it if it appears around you again. Do you feel tied up by some kind of emotion these days? How do you deal with it?
Many times we are afraid because we don't know, but when we all know, we won't be afraid.