Bat-gwai/Bai-guei is a slur used to describe Whites in a derogatory way. "Bat-gwai" is the Cantonese for "white ghost;" or as we more commonly hear it translated, "white devil." It may be worth noting that white is the color of death and mourning in China, as black is in Europe and America.
The word Bat-gwai/Bai-guei is a racial slur that has been used historically to degrade and dehumanize whites. The word is still used by some people for this purpose, and it is seen as offensive and hurtful to whites. If you are unsure about whether or not it is appropriate to use the word Bat-gwai/Bai-guei, it is best to err on the side of caution and avoid using it in any situation.