Once the proper tip is installed, fill the bag through the end with the wider opening, roll or twist it closed, and then squeeze it like a tube of toothpaste (from the top down, keeping the lower portion bulged out) to pipe its contents.
Though a circular nozzle is quite useful for making round shapes, many types of tip are available. The tip shown in the far left of the photo is a hypodermic-shaped one for filling pastries such as cream puffs, and many other types of nozzle are available for making star, leaf, and flower-petal shapes.
Aside from icing, pastry bags are commonly used to shape meringue and whipped cream, and to fill donuts with jelly or custard. When presentation is especially important, fluted tips can be used to shape savory foods such as filling for deviled egg, whipped butter, and mashed potatoes.
A high-quality bag is often made from waterproofed cloth, with a collection of interchangeable chrome-plated or stainless steel tips. Each tip is cone-shaped, with a base too large to fit through the small opening in the bag; they are to be inserted through the larger opening before food is spooned in. Less expensive models are generally of plastic film with screw-on plastic tips, while many foods (including frosting and pressurized "spray can" whipped cream) can be purchased in disposable packaging designed to serve the function of a pastry bag.
A simple pastry bag can be made by rolling cooking parchment or wax paper into a cone, filling it, folding the wide end several times to close it, and then cutting the tip into whatever shape is desired. This is especially useful for small quantities of melted chocolate, since a very small hole can be cut and the bag can be discarded when it cools and becomes clogged.