Possession is a practice, so naturally if you know what you're doing you can be able to withhold a spirit or entity from having complete control over you. This possession usually happens after trust is built.
If this is not the case, and a spirit or entity has control over you, you might be able to use knowledge and confidence to your ability. If you're familiar with banishing and exorcisms of some degree, that's great if you can complete them. If you aren't able to exert control over it, seek the private help of a pastor or practitioner.
I think it's safe to say that if you don't have absolute confidence in your abilities, you shouldn't be messing around with possession.