In addition to ingredient-specific tips (like being sure to add enough flour and making sure the butter isn't too warm), rolling the dough into tall rather than round balls, making sure your oven isn't too hot, not greasing your cookie sheets (and using parchment paper), and never putting cookie dough onto a hot baking tray will all help to keep cookies from spreading.