Detect and Remove Cycles in Linked Lists

How can you detect and remove a cycle in a linked list efficiently? Explain the approach, algorithm, and time and space complexity, preferably with an example.