Still

Right. It was not only Su Yu who has taught Duan Yuan, which was during in their previous life (world), but also Kong Weijun, who taught Duan Yuan in this life (world) as Duan Yuan's master when Duan Yuan was 'reborn' in this world and lost all his memories of their previous life as one of the effects of Duan Yuan trying to take back Su Yu's life after Su Yu died in their previous world.

As far as Su Yu knows, Kong Weijun was a disciple of a secluded Taoist master in their previous life, which was one of the reasons why Kong Weijun ascended as an immortal after he died (as a mortal) in their previous life (world). So, Kong Weijun's master should have imparted lots of knowledge about Taoism, including exorcism of ghosts and demons.