Add your sprinkles after baking and icing your cookies, while the royal icing is still wet. This way, they will stick to the cookies and won't fly off as you pick up your cookies.