If your iMac freezes, walk away from it and give it time to fix itself. If the issue persists, press Option-Command-Escape and ‘Force Quit’ the frozen app. If that still hasn’t solved the issue, try powering down the iMac and then turn it back on again.