Because resources are generally not dynamic, the easiest way to break such a cycle is to terminate a process. Usually the process is chosen at random, but if more is known about the processes, that information can be used. For example the largest or smallest process can be disabled. Or the one waiting the longest. Such discrimination is based on assumptions about the system workload.
Some systems facilitate deadlock recovery by implementing checkpointing and rollback.
Checkpointing is saving enough state of a process so that the process can be restarted at the point in the computation where the checkpoint was taken. Autosaving file edits is a form of checkpointing. Checkpointing costs depend on the underlying algorithm. More complicated processes may have to save all the process state and memory. Checkpoints are taken less frequently than deadlock is checked for.