Some machines have attachments that will ruffle or shirr. Another way, more labor intensive, is to zig-zag over a thread, not touching it. You pull the center thread and adjust the gathers. It takes a while to get them even, aspecially if you are doing both sides for a shirred effect.