**Prepare the Ingredients**
- Ensure all ingredients are at room temperature for the best results. Sift the powdered sugar to remove any lumps, which helps achieve a smooth icing.
**Beat the Egg Whites**
- In a large mixing bowl, combine the egg whites and cream of tartar. Using an electric mixer or stand mixer fitted with the whisk attachment, beat on medium speed until frothy, about 1-2 minutes.
**Add Powdered Sugar Gradually**
- Gradually add the sifted powdered sugar to the egg white mixture, about 1/2 cup at a time, while continuing to beat on low speed. This helps prevent the sugar from flying out of the bowl.
**Increase Mixer Speed**
- Once all the powdered sugar is incorporated, increase the mixer speed to medium-high and beat the icing until it becomes thick and glossy, about 5-7 minutes. The icing should hold stiff peaks when the beaters are lifted.
**Add Flavor and Color (Optional)**
- If desired, add vanilla extract for flavor. To color the icing, add a few drops of gel or liquid food coloring and mix until the color is evenly distributed. Gel colors are preferred as they don't alter the icing's consistency.
**Adjust Consistency**
- For piping, the icing should be thick but still flow smoothly. If the icing is too thick, add a few drops of water, one at a time, until the desired consistency is reached. If it's too thin, add more powdered sugar until it thickens.
**Use or Store the Icing**
- Transfer the royal icing to piping bags fitted with your choice of tips for decorating. If not using immediately, cover the bowl with a damp cloth or plastic wrap to prevent the icing from drying out. Store in an airtight container in the refrigerator for up to one week. Re-whip before using if it has been stored.
**Decorate Your Treats**
- Use the royal icing to pipe intricate designs, outline shapes, or flood decorated cookies for a smooth finish. Allow the icing to dry completely, which typically takes several hours, depending on the thickness of the layers.