Cookies have been around since the 1500s. There is some evidence of a flour spices water mixture in Roman times that could qualify, but it wasn't until the 1600s France that the cookie really began to gain favor and prominence.
French chefs began incorporating egg whites into their cookie and the Macaron was born. It wasn't until late in the 18th century that creaming butter and sugar togther to form a base for a cookies was put into practice.
What I am getting at is the evolution of the cookie. As you begin baking, you choose a tried and true recipe from a known source, whether it be mom, grandma, or Betty Crocker, you've tasted it, liked it and will venture forth to bake your own. As you gain confidence in the kitchen you look for other sources, try some new things and enjoy more exotic forms of cookies. Then comes that day, the day you are expected to bring a cookie for an event, and you are short on time. You quickly mix up that tried and true recipe only to find a signature ingredient is missing. You don't have time to run to the market, what do you do? You improvise! No walnuts on hand? Use pecans instead. Or macadamias, or peanuts.
Let me explain what I mean by signature ingredient. Say you're making pecan swirls. Well, the signature ingredient is pecans obviously.You don't have any on hand. As previously stated, you can substitute a different nut. same with dried fruits and candies. Jams can be used interchangeably. Cocoa and chocolate can be exchanged out with some special considerations. When using cocoa,when chocolate is called for, make sure you understand how to make that alteration. So next time you don't have the item on hand, try something else. Once I didn't have any of the things the recipe called for, I simply used what I had on hand and had three people ask me for the recipe. Problem with that was I wasn't quite sure what I had done.
Key ingredients. Now there's a different issue. When a recipe specifies baking soda, baking powder is not a replacement. There is a difference between brown sugar and granulated sugar. Butter and margarine can usually be switched out and one or the other used. However, be careful with that, as they do act differently in certain recipes. Using lite margarines are not recommended as they have quite a bit of water in them and they can be disastrous to a recipe. Using them without knowing what it will do can make you lose confidence in your skills and you mistakenly think you can't cook. When a recipe calls for unsalted butter use it. It is very important for the flavor to be right and added salt can change that when using regular butter. Colorado State has a good substitutions list for cooking.
Always try to use fresh ingredients. Keeping your pantry full and rotated is important to produce foods you'll enjoy and you family will love eating.