Rosemary, like many herbs are fun because they are generally easy and rewarding to grow and can be used in so many ways such as: flavorings, perfumes, decorating, vinegars and medicinal purposes.
Rosemary as many other herbs can be preserved by drying. There are several ways drying can be accomplished: 1.) hang drying 2.) dehydrator 3.) oven and 4.) microwaving. However the hanging method, in my opinion, is the best due to the benefits of gravity. When hanging, the plant's natural oils, which contain the fragrance and flavor, are forced down into the leaves.
Harvest rosemary when the stems become tall & lengthy. If to be used for cooking, wash the rosemary well and pat dry. Tie a few stems together by wrapping string, thread or rubber bands around the cut ends. I prefer rubber bands because of the shrinkage factor with the stems. Hang the rosemary bunches upside down from a rafter, clothesline or other structure, preferably in a cool shaded area. Consider even the garage or attic. Allow the bunches to hang freely with adequate air circulation around them which is essential. The rosemary should be allowed to dry until it is brittle, which is the case with other herbs as well.
I devised my own drying rack by taking a 6 - 8 foot board (or pole) and mounting a cup hangar every foot or so. I then place the rubber bands on the tied ends of the rosemary bunches onto the cup hangar. Once I have them all on the hangars, then I simply hang the board on two rafters in my garage.
A few last thoughts about rosemary. Don't be afraid of harvesting the rosemary too soon. Cutting or pruning the plant will actually stimulate growth and allow your plant to become more productive. Fair warning about growing rosemary, it likes well drained soil and full sun. Generally speaking, rosemary will not survive in cold climates (zone 1 - 6). However there are different varieties and some are considered perennials in several zones.
Have fun growing, drying and using your rosemary and enjoy!