The basics of rocket science really are pretty simple. Send a lot of hot gas out one end of a rocket, and it will go in the opposite direction. You know what’s hard? Orbital mechanics, maneuvering a spacecraft to rendezvous with something else. Or at the very least, it’s counterintuitive.
On June 3rd in 1965, the Gemini 4 mission was launched, with Jim McDivitt and Ed White as the passengers. The mission is best remembered for White’s spacewalk, when he opened the hatch and floated free, attached to his craft only by a tether.

https://www.nasa.gov/wp-content/uploads/2023/03/178429main_image_feature_838_ys_full-a.jpg
Before that however, McDivitt was instructed to rendezvous with the spent second stage of his Titan booster, trailing behind him in orbit. Being able to find and meet up with another object in space was crucial to the success of the moon missions, where the two astronauts in the lunar module would have to catch the command module for their ride home. McDivitt did what seemed quite natural to an experienced pilot. He turned his capsule around, pointed it at the rocket stage, and fired his thrusters.

https://live.staticflickr.com/5814/22836085892_9af3aec7eb_b.jpg
What happened? Not what he expected! He found himself moving away and downward.
NASA had not yet figured out quite how things worked in orbit. Counterintuitively, you have to slow down in order to speed up. And doing so lowers your altitude.
Something orbiting close to the Earth, where its gravity is stronger, has to move fast to stay in orbit. The International Space Station orbits at 17,160 miles per hour, 250 miles high. Communication satellites that appear stationary from the ground orbit 22,236 miles high, at 6,867 mph. And when the moon is at its average distance of 239,000 miles, it is moving at the leisurely pace of 2,258 mph.
Of course this problem was solved, and any time astronauts launch to the ISS, they apply the lessons learned. What would have worked for McDivitt?
With an object behind him, he would need to increase his speed by firing his thrusters. This would move him into a higher orbit, where he would move more slowly. This would allow that Titan second stage, moving faster in a lower orbit, to catch up. Eventually the Gemini spacecraft would be behind the rocket stage. A series of maneuvers that allowed him to match orbits would let him rendezvous.
This excellent animation will tell you all about it!