Prevent pepper spray effect when cooking raw hot peppers
You have a couple of options, one is to wear a respirator or a bandanna that is soaked with water over your mouth. There really isn't any way around these fumes being created when you put peppers on a hot pan unless you cook them at a very low temperature.  The reason is that the capsaicin molecules become airborne when heated.

Whenever I cook with peppers I incorporate them in with the dish after I have done any sort of frying.