just curious, does confession stop demons or is it necessary to use exorcisms or both?
first of all, the way to approach a “ghost” is to pretty much ignore it in the way of “communication” or “interaction”, and simply pray and take the necessary action recommended by the church, which depends on the circumstance, like if your house is haunted, then get it blessed,
we must never try to interact with a ghost, which is what we call a human spirit, but can very likely be a demon, and it should always be taken with extreme caution even if you think it’s someone you know, because the devil can take on many disguises, even that of Jesus or Mary,
in the case of possession though, since you asked about “exorcisms” the only thing you can do if you are possessed is find an exorcist priest, or if you can’t find one, go straight to your bishop, who is obligated to help you in matters of demonic possession under pain of mortal sin,
but no, confession does not stop possession, while by possession the devil has control over mind and body, but he does not have control of your will, and cannot force you to sin, so confession and possession are not connected with each other, but instead possession has more to do with some sin you are attached to, such as not being able to forgive, or looking at porn, or some other grave sin that invited him in,
and casting out demons is something only an exorcist priest or bishop can do, although by the popular medias portrayals of possession and exorcism, there is a very naive and false understanding of these things, but in that case the church recommends* “it is prudent, wise and highly recommended that church teaching and long-standing practice be the guide, along with the witness of Sacred Scripture and the lives of the saints”*
although there is also demonic “oppression” and demonic “harassment” which are different from possession, and which also need help from a priest or bishop…but that’s another subject.
so to answer your question, in the case of ghosts or possession, just go to your priest or bishop…if they don’t help(which is not uncommon nowadays) then find another until one will help you.