One of the best tips for dairy-free baking is for the cook to learn about what role each of the ingredients in a baked dish plays. Butter, milk, yogurt, cream, and cheese can all be successfully substituted with non-dairy alternatives, though the exact alternatives used will vary from dish to dish. A cook should learn the reason a dairy product is used in order to choose a suitable alternative.
When substituting dairy-free alternatives for dairy products in baked goods, it is important to choose the appropriate substitution. Butter can be replaced by either oil or margarine, but the quality of these different fats will greatly affect the outcome of the baked goods. The butter in a cookie, for example, can be replaced with an equal amount of dairy-free margarine, while the butter in a cake, because it is beaten with sugar to help texturize the cake, may need to be replaced with a combination of oil and ground nuts. Some of the qualities of dairy products can also be replaced by eggs in dairy-free baking.
Milk and cream are easier to replace in dairy-free baking. Milk can often be simply replaced by soy, coconut, or rice milk, or even water, especially if a recipe already calls for reduced or non-fat milk. In recipes that use heavy cream, canned coconut milk is often a good alternative because it is heavier and more flavorful than other plant-based milk substitutes. Non-dairy yogurts and cheeses can be substituted for dairy versions of these products though they may not combine with the other ingredients in the same way that dairy would and, in some cases, the quality of these non-dairy substitutions may change when a cake or pastry is heated.
If a person is combining dairy-free baking with egg-free baking, such as for a vegan recipe, a number of other things need to be taken into consideration. Eggs and dairy products often act to bind ingredients together as they bake, forming a substance that is moist and soft and that holds together. Removing eggs and dairy from a baked good can cause the dish to lose some or all of these qualities. To compensate for this, a number of additional ingredients, such as xanthan gum, agar powder, or arrowroot may be needed as binding agents. The use of these types of ingredients shouldn't affect the flavor of the dish, as long as they are used in moderation.