For the Mac “Time Machine” is included. All you need is an external USB drive. A one Terabyte drive should work for most iMacs.
For the PC I don’t trust the Windows Backup & Restore. I’d recommend Acronis true image: https://www.acronis.com/en-us/
I also use Backblaze cloud backup: https://www.backblaze.com/