A return for landing after takeoff could be due to an emergency situation, or an operational need. Part of the clearance that the flight receives is the initial routing after takeoff. The aircraft will be expected to follow that routing. If a problem occurs which does not permit climbing on that routing, the flight will also have a procedure, not known to air traffic control and usually not a charted procedure that's published, which the crew will follow. This is the engine-out procedure, or what used to be called the "pink page" procedure.
The pink page, or engine-out procedure is something published for a specific operator, not availble elsewhere, and is what the operator will do in the event of an emergency while departing that runway. It's briefed along with the rest of the takeoff and departure.It may be a climb straight ahead, or it may be a turn to a specific heading, or may involve a more complex series of directions for terrain or other reasons (political boundaries such as the 38th Parallel in South Korea, for example).
If the crew has a reason to return and does not have an emergency that limits climb performance or aircraft control, the crew will notify ATC and either request priority handling (eg, declare an emergency or or urgency situation ("mayday, mayday, mayday," or "pan, pan, pan"), and will be directed accordingly. It may be an ill passenger, and the flight may follow the original routing and then be given a turn, or vector, to join the final approach course.
During that time, the crew will follow their normal procedures, if an emergency does not exist, including the relevant checklists and cockpit flows (steps the crew takes at each phase of flight, before doing the checklist). If an emergency does exist, the crew will address the memory items necessary to handle that emergency and stabilize it, then the relevant abnormal or emergency checklists, then the normal checklists, and then arrange the return for landing, as appropriate.
Because many flights depart at a weight that is too heavy to land, the flight may need to be vectored to a point where fuel dumping may occur, to reduce weight to a landing weight. In some cases, there may not be time, and the flight may have to accept an overweight landing. In that case, the airplane will be grounded after it arrives, pending an inspection.
Properly done, in most cases, the flight will end up looking like a big rectangle, climbing out, with a crosswind, downwind, base, and final leg, to land. Generally, a crew will set up the aircraft for a return to land, as part of their departure preparations, and will have briefed the return to land, and will know in advance their dump time and other particulars of the return. This is all done before the aircraft has pushed back from the gate, or started engines.