بسم الله الرحمن الرحيم
In case a jinn, ghost and witch is seen, one should recite Ayatul Kursi and mu’awazatain loudly. In-shaAllah, the jinn or ghost shall go away and will not cause any harm.
Allah knows Best!
Darul Uloom Deoband
This answer was collected from the official ifta website of Darul Uloom Deoband in India.