The Prophet ﷺ advised that the deceased be perfumed with bakhoor. In this regard, he said, ‘When you perfume the deceased with bakhoor, then perfume him three times.’ (Ahmad).
The Prophet ﷺ also advised that the Masjid be perfumed with bakhoor and scented, especially on the day of Jumuah.’ (Ibn Majah). In this regard Aisha (R.A) reports that the Prophet ﷺ ordered that Masajid be built in residential areas and they be cleaned and perfumed. (Ahmad, Abu Dawood). It is narrated that Abdullah would burn bakhoor (incense) when Umar would sit on the Mimbar (pulpit). (Abu Dawood).
Aisha (R.A) said, ‘Perfume the Ka’ba, because this is a part of purifying it.’
From these traditions, it is evident that it was from the practice (Sunnah) of the Prophet ﷺ to use bakhoor (incense) and burn the oudh sticks as a means of perfuming the Masjid, homes, other places and even around the deceased person.
However, there is no narration or statement which says that bakhoor wards off evil.
And Allah Knows Best.
Mufti Waseem Khan.
This answer was collected from DarulUloomTT.net, which is operated under the supervision of Mufti Waseem Khan from Darul Uloom Trinidad and Tobago.