Most spirits people come across are not harmful. Regardless of belief, they are merely energy left over from a being. Although you may be awake in the physical when seeing them, they are not truly on the physical plane.
Spirits seek people out for many reasons. It could be a desire to be acknowledged. They may want to pass on a message. They might even be a guide or guardian. The best way to find out is to communicate with them.
You can speak with a spirit or entity in many ways. The best I have found is invoking. Simply put, it is asking for them or calling to them. You can do this by calling their name, if you know it, or by saying something simple like " I am here listening, can we talk?". To some this sounds silly, but it often works. It helps if you are relaxed and able to focus for communicating with them. Some use meditation for this purpose.
There are various tools you can use, if you wish to do so. Crystal balls for scrying or to help clear your senses, tarot for spirit divination, automatic writing as a way of letting the spirit write through you, Ouija boards (aka spirit boards), the list goes on and on. You do not have to use these tools, but some like to use them as aides.
When you are done communing with a spirit, you should thank them for their help. Take notes on what you learned, in case you wish to reflect on it later. Ground and/or balance your energy so that you are not left feeling odd.
Remember that they are beings too. They are not a tool to be used and dumped when you are done with them. They should be treated with respect, like any person that helps you.
The thing I abhor the most is hearing "How do I banish it, I do not want it in my home". Regardless of who was there first (most often the spirit XD) they have just as much right to be there as you. Unless they are causing harm, I feel you should let them stay. If you are worried that they are harmful, do a simple smudging and you will know. If they act up after the smudging, then you need a proper banishment for that entity.
For a smudging, you burn sage. It does not matter what form of it you use. You can use incense, a smudge stick, dried leaf, ground, rubbed pretty much any form as long as it is burnable. Make sure you use a fire safe container to burn it in. Light it and walk from room to room. Make sure you fan the smoke so that it goes in every corner of your home. It is best to start in the most negative place in your house.
Some spirits are actually spirit guides. The term literally means a spirit that guides and/or teaches you. Each guide has its own way of teaching and/or guiding. Everyone experiences this somewhat differently, because we are different.
One of my guides would physically block my path, if headed in the wrong direction, or make noises at me when I was doing something wrong. Another would outright speak with me. Sometimes they are things we would find to be upsetting as well. I knew someone that was deathly afraid of spiders. They would often find them nearby. She was a skeptic, yet her mom studied paganism, and is a wonderful reader. One day she saw a giant one in a dream hovering over her. She asked me to look them up. Come to find out, they symbolize strength, magic and power. Ever since then, she has been a believer and speaks of her spider guide often.
Like I stated before, not all spirits are malicious. Communicating with them is only as difficult as you make it. They should be thanked for their help and respected. Above all, do not banish, just because they give you the "jitters".
Love, light and blessings :)