The best way to prevent spices from burning is to first temper them in hot oil and to make sure you are using enough oil so that the spices do not stick to the pan.