Adapting smoothly to adversity is a culinary skill that's only learned through experience, but you can shorten the learning curve by memorizing a few basic, standard substitutions. That's especially so in baking, where you'll encounter the same basic handful of ingredients time and again. For example, if you're knee-deep in a recipe and find you've run out of baking powder, soda can usually ride to the rescue.
Powder vs. Soda
Baking powder is nothing more than baking soda that's been mixed with dry acids, as well as cornstarch or other "buffer" ingredients designed to keep the powder dry and prevent the ingredients from reacting prematurely. For every teaspoon of baking powder called for in your recipe, you'll need just 1/4 teaspoon of soda to replace its leavening action. You'll also need to furnish the necessary acidity, adding either 1/2 teaspoon of cream of tartar or a cup of buttermilk or soured milk to the recipe in place of sweet milk. Alternatively, add a tablespoon of lemon juice per cup of milk.
The drawback to these substitutions is that once your recipe is prepared, it must go in the oven immediately. The soda will begin to react with your acidic ingredients as soon as the dough or batter is mixed, and if you don't get your goods in the oven right away, that leavening power will be largely wasted. Commercial baking powders dodge this difficulty by using multiple acids, one that reacts immediately and then one or more others that won't act until they reach the oven's heat.