Jump starting sounds like a simple old-school task, but mistakes here can damage electronics, melt connections or in the worst case create a dangerous situation. That is why it is worth slowing down for a moment and thinking through the sequence first.
Start by making sure both vehicles use a compatible voltage system and that the jump leads are actually in decent condition. Very cheap and thin cables may look acceptable in theory, but in real use they often do not carry current well enough.
The general logic is to connect the positive terminals together and connect the negative side last to the correct ground point rather than automatically straight to the flat battery terminal if the manufacturer specifies otherwise. On modern cars it is wise to follow the owner's manual whenever possible because not every setup is identical.
After connecting, let the donor car run for a little while and do not immediately crank the dead car over and over again. If it still refuses to start, the problem may not be just a weak battery. At that point it is smarter to stop than to keep forcing the system.
When removing the leads, work in the reverse logic and avoid letting the clamps touch each other or random metal body parts. Many mistakes happen here simply because people assume the difficult part is already over.
If the car starts, that does not automatically mean the problem is solved. A flat battery can be just a symptom. The real cause may be an ageing battery, poor charging, or a parasitic drain while the car is parked.
It is also a good idea to make a note of when the problem happened and what eventually solved it. If the issue comes back later, that record makes it easier to understand whether the battery was simply old or whether a larger electrical problem is developing.