As far as I remember from the book, it doesn’t list an “official” way to exorcise.
I bet this is by design.
It’s really up for you, ideally together with the players, to decide. You can make the ghosts as simple (just compel it, or even a simple attune) or as hard (you need a specific ritual) to deal with as you desire.
As long as it’s fun and entertaining, it’s the “right” way to play.
This sort reminds me when I was discussing the technology level of the world with my players. Basically they wanted to know if telephones existed (not the mobile ones). At the moment I let them be, since it made sense for me. Later, I searched around the web and wrote a few paragraphs detailing the level of technology, from vehicles to communication and so on, then presented it to them. They all agreed and we stick to it from them on.
Moral of the story: As a rule of thumb, go for way you feel is more natural / makes most sense for you. If a player interjects, you can always explain your reasoning and ask their opinion on it. Worst case, you change it to what feels best for everybody.
Keep in mind that, it being easy or it being hard not necessarily implies how it’s going to be played out. For example, you can say that exorcising is a really complicated ritual. They can play scores going after the materials / performing it, or simply make a clock and they fill it as a downtime activity, maybe an “acquire asset” to find a suitable NPC. Both are, in my point of view, valid scenarios. This applies for everything else, really.
Now on my personal opinion on it, or rather, what makes most sense for me:
While “invading the body” players can interact with the spirit directly and “pull it out” of the person easily and directly (quite literally if someone has the “Ghost Hands” ability).
Once completely inside, however, things change. In order to force the ghost to leave, you need to compel it, but being hidden deep within the person, adds an extra complication. “Mechanics wise”, compeling it would have zero (or lower) effect. There are a lot of possibilities what they could do in this situation: perform a ritual (perhaps a more powerful way to compel), call a Railjack or Witch to help (someone that has more experience and items to increase the effect), maybe trade position for effect (risking the possessed own soul in the process?), search for some sort of “Ghost Repellent” potion and drink it (a rare item they need to craft) and so on.
As a last piece of personal advice, keep in mind that due to the “sandbox” nature of BitD, it is quite impossible to plan for everything. Of course, its always nice to have a general idea all around, but don’t get stressed if you didn’t plan for something. In these cases, do as the book says: “play to find out what happens”.
Remember you can always ask the players, it’s a neat opportunity to expand their background. Suppose there’s a character that used to handle ghosts, just “So, did you know about anyone that was exorcised? How did they do it?”. Likewise, if they know some NPC related to the supernatural, you can “So, NPC Name knows a lot about the supernatural. Have they told you something about it? Maybe mentioned?”. Finally, there’s always the reliable “Have you heard any rumors on this? How do you / your character knows?”