Removing the drill bit from the wooden stud should be simple. The smooth shank of the drill bit will be protruding from the stud. Use a pair of pliers to pull on the drill bit. If it doesn't come out easily, turn the bit counterclockwise while pulling out.
Prevent the problem of a stuck drill bit by paying attention when attaching the bit to the drill chuck. The drill chuck holds the bit, and loosens and tightens to allow you to interchange various size bits. When inserting a drill bit, use the chuck key to tighten the drill bit completely. Tighten all chuck holes.
If instead, the drill bit has gotten stuck in the stud of a metal bolt, during an attempt to extract the broken bolt, you might need machine shop tools. You can try welding some stock to the broken bit to give yourself something to grab onto. You can use a plasma cutter to remove the material. You can also use tap extraction that will electrically disintegrate the stud.