Dry granulated sugar can be applied to baking recipe before or after baking. It is great to use for crafty baking decorating, plus it adds a sweet flavor and crunchy texture. To help the sugar stick before baking, with a clean pastry brush, brush the pie crust dough, for example, with cream or a beaten egg white, top with a light coating of sugar and bake. After baking, for example, with cookies, apply the sugar to the wet icing or piping gel. 

The sugar can be tinted beforehand. 

PIES: BEFORE BAKING – HOW TO APPLY CRYSTALLIZED TABLE OR SANDING SUGAR
Sugar can be applied to pie crusts before baking. This technique is used with the The Ultimate Apple Pie Recipe with a Rum Raisin Sauce Recipe.
The Ultimate Apple Pie Recipe with a Rum Raisin Sauce Recipe

Here's how to:
1. Brush the top of the unbaked pie lightly with milk, cream or egg white or whole egg wash.
NOTE: Do not brush the edges of the pie, or sprinkle it with sugar, because it will make them brown too quickly.

2. Carefully and lightly press the design on top of the pie.

3. Sprinkle the pie, except for the apple design and the edges, with sugar.

4. Then, cut the steam vents and bake.

COOKIES: AFTER BAKING – HOW TO APPLY SANDING SUGAR TO WET ICING
This is done with the Snow Globe Cookie Ornaments Recipe. To help the sugar stick before baking, decorate the cookie with royal icing or brush each cookie with beaten egg white with a pastry brush, top with a light coating of sugar and bake. 

Piping gel can be used: For a festive look, you can top your cookie or the areas to be decorated with clear piping gel. Piping gel can also be used with a stencil. Then, while still wet, sprinkle colored or sparkling sugar onto it, and let dry. Piping gel can be also flavored with concentrated flavoring oils. Snow Globe Cookie Ornaments Recipe

Here's how to:
1. Put the sanding sugar into a small bowl. Decorate the cookie with royal icing. Do NOT let it dry.

2. Place a plate on the counter and hold a cookie above it. Using a teaspoon, sprinkle sanding sugar over the wet royal icing, till it is completely covered.

2. Carefully tip cookie, letting the excess sanding sugar fall onto the plate.
After coating a few cookies in sugar, pour the excess sugar, that has fallen onto the plate, back into the bowl of sugar, and reuse.

3. Set cookie aside to dry, and then repeat these steps with the rest of your cookies.