Spirits are left-over remnants of people who died. Why some people leave behind remnants of themselves after death is unknown, but there is a strong correlation with being unable to move onto the afterlife because they feel incomplete. Though called spirits, the exact nature of these anomalies is unknown.
They retain some of their memories in life, and are sentient and capable of communication but cannot interact with the world and are trapped at the site of their death.
During the Millhaven incident, Rusty came across the spirits of the recently slain townspeople and was able to ask them about what happened. Most were able to provide small details about what happens, and provide clues about the cultist's mission and Mr. Jekyll's plan. However, they were trapped in Millhaven by their desire for vengeance which Rusty sympathized with. Once Mr. Jekyll was slain, they were able to pass into the afterlife completely.
Spirits may give useful information. However, spirits can only give information about their immediate surroundings but this can include things that happened after death. Rusty is the only character who can see and interact with Spirits. It's worth noting however that the AMC PDU can detect the presence of a Spirit, and will show an information blip where the spirit is located by noting a location has benign paranormal activity.