How to Toast or Roast Spices
When creating a spice blend, the goal is to achieve as many layers of taste, flavor, and texture as possible. Toasting or roasting spices allows you to get there. Sanitation, releasing essential oils, and driving out excess moisture are also great reasons to roast or toast spices.
However, not all spices can or should be toasted. Herbs and powders are very likely to burn if toasted. Other types of spices don't get any benefit from being toasted, like white and black better. For the most part, it's trial and error. Or, you can check out Lior's recommendations for which spices to toast in The Spice Companion.
You can toast spices in a pan on the stove or dry roast them in the oven. Both methods work well; it's a matter of preference.
Pan Toasting
Pros: You can see what's happening in the pan and smell when the spices are ready.
Cons: You have to keep an eye on the pan and stir continuously because the heat is only coming from the bottom.
Method: Put your spices in a skillet and toast over medium heat, stirring constantly with a wooden spoon. Once you start smelling the aromas, transfer the spices to a cold container to stop the cooking. For first timers, start by toasting the spices individually. As you get more familiar, feel free to go all in. There are no cooking times, so it's up to your personal preference and fragrance. You'll know if you've gone too far.
Oven or Dry Roasting
Pros: You get uniform results; it's easy to do and efficient. Oven roasting is also great for multitasking because you don't have to worry about stirring or burning.
Cons: You'll have to wait for the oven to preheat, which can be timely. Also, you'll need to open the oven and smell for doneness. If you roasting in a convection oven, be sure to cover the spices with a second baking sheet, otherwise the spices will blow away.
Method: Preheat oven to 350°F. Pour spices onto a rimmed baking sheet, cover with a second baking sheet, and transfer to oven - covering ensures that the spices don't spill out and ensures that they get heated from top to bottom. Set the time: start with 2 or 3 minutes and add more time as you go. On average, it should take 5 to 8 minutes. Check doneness by smelling!