When a racing car crashes at a racing circuit, they usually cannot be driven back to the pits or even driven onto a trailer or low loader. They are therefore recovered by being lifted up onto a flatbed truck equipped with its own hydraulic crane.
Sometimes the car can be towed back to the pits (using any suitable vehicle if a recovery truck is not available.
Most of the time the recovery trucks just wait beside the track or in the paddock.
At the end of the race the trucks spring into action.
Some cars are even transported to and from the racing circuit on the back of a crane equipped, flat bed lorry. These are mostly stock cars (used for banger racing).
If you want to make your own, here are some close-ups of a crane and the hydraulic control levers.