How can I straighten twisted studs?
If the 2x4 is not too twisted, then you can probably just use a clamp or a block. Start by fastening one end of the stud in place, and then use one nail to fasten the other end. The nail should be placed such that one of the edges of the stud is centered (as it should be). The other edge (lets call it edge B) will not be on center until a clamp or block is used to straighten the stud. If edge B is off center such that it is closer to the adjacent stud, the a block should be inserted between the two studs. Once the stud is aligned with the appropriate center, nail it in! Or if edge B is further away from the adjacent stud, a bar clamp can be used to pull it back toward the center.

If the stud is very twisted, you can relieve much of the stress with boiling water. You will need to boil about 1-2 quarts of water. With the twisted stud in place, (3 nails in it) begin pressing/untwisting it with a block or clamp. After you have untwisted it partly, wrap a towel on the on the area (2 to 5 ft) with the most twisting and pour the boiling water onto the towel. Pour slowly allowing the hot water to contact and saturate the wood. After a few minutes continue to apply pressure with the block or clamp. It may take up to 10 minutes for the wood to begin to soften. Again, once the stud is aligned with the appropriate center, nail it in!

Note: boiling could soften the wood too much, and allow compression failure. Source: (http://www.primitiveways.com/bending.html). So, studs treated with boiling water should not be used for load bearing walls.