There is a type of bit that drills square holes. It's not magic, it's a drill bit inside a square box that cuts perfectly square holes when you drill. As the drill bit bores down, sharp edges on the box cuts the square corners. Typically used for the traditional mortise and tenon joint, a drill press mortise cutter will drill perfectly square holes or rectangular holes for any size tenon by drilling square holes side-by-side. You can use a drill press mortise cutter on any drill press.
Insert the square hole cutter into the drill press just as you would any drill bit.
Position the wood under the cutter just as if you were going to drill a hole in it.
Hang on to the wood with one hand and bring the handle down with the other hand to bore the cutter into the wood. Go slightly slower than you would when using a common drill bit. The outside edges of the cutter will shave the round hole into a square as you push down.
Pull the drill press handle down until you reach your desired depth. If the cutter clogs or slows down while drilling, pull it out of the wood, and then plunge it back down again to clear the sawdust.
Wrap a piece of masking tape around the cutter to mark the depth before drilling. Stop drilling when you come to the tape. You can buy any size mortise cutter but the most widely used is 1/2 inch.
Always wear safety glasses when working with wood.