Gemini 8 did it the wrong way - a mishap caused the spacecraft to spin wildly generating rather strong g forces. An almost disaster -- see the emergency section,
There was some suspicion on the ground that the Agena's attitude control system was acting up and might not have the correct program stored in it. This suspicion was found to be incorrect. Shortly before radio blackout, Mission Control cautioned the astronauts to immediately abort the docking if any abnormalities occurred with the Agena.
After the Agena began execution of its stored command program, which instructed the Agena to turn the combined spacecraft 90° to the right, Scott noticed that they were yawing. Armstrong used the Gemini's OAMS thrusters to stop the yaw, but after it stopped, it immediately started again. Gemini 8 was out of range of ground communications at this time.
Armstrong reported that the OAMS fuel had dropped to 30%, indicating that the problem could be on their own spacecraft. With concern that the high yaw rate might damage one or both spacecraft or even cause the propellant-heavy Agena to rupture or explode, the crew decided to undock from the Agena so they could analyze the situation. Scott switched the Agena control back to ground command, while Armstrong struggled to stabilize the combined vehicle enough to permit undocking. Scott then hit the undock button, and Armstrong fired a long burst of translation thrusters to back away from the Agena.
Without the added mass of the Agena, Gemini starting tumbling end-over-end more rapidly. Soon after this, the spacecraft came in range of the ground communications ship Coastal Sentry Quebec. By now the tumble rate had reached one revolution per second, blurring the astronauts' vision and threatening loss of consciousness or vertigo. Armstrong decided to shut down the OAMS and use the Re-entry Control System (RCS) thrusters to stop the tumble. After steadying the spacecraft, the crew tested each OAMS thruster in turn and found that Number 8 had stuck on. Almost 75% of the reentry maneuvering fuel had been used to stop the tumble, and mission rules dictated that the flight be aborted once the Reentry Control System was fired for any reason. Gemini 8 immediately prepared for an emergency landing.