How Can I Clone a Clean MacBook Pro and Use the Clone to Restore a Messy iMac?

I have an iMac and a MacBook Pro. The iMac is messy (leftover files from improperly deleted apps), while the MacBook Pro is clean and well-organized.

So, I want to make the iMac a clean clone of the MacBook Pro.

Here are the steps I’m going to proceed with:

  1. Use a new external hard drive to back up important files from the iMac first
  2. Create a bootable clone of the MacBook Pro
  3. Erase the iMac’s hard drive
  4. Restore the MacBook Pro clone onto the iMac

I want to know whether anyone has done a similar task? Can I do it successfully?