Best surgical way to archive, wipe and clean install Catalina on a 2017 MacBook Pro

If you believe that macOS has been infected by malware, then you can try reinstalling macOS from macOS Recovery without losing personal data and settings.

If you believe that malware has infected your personal files, then I would recommend backing up necessary personal files to your external hard drive by copying and pasting them. Doing a Time Machine back up will bring your problems along with you because it backs up every single thing.

After you have your files, boot into macOS Recovery (reboot then Command + R). From there, go to Disk Utility and Erase Macintosh HD (and Macintosh HD - Data on Catalina). If you are on Catalina, then you will get an error when attempting to erase the contents of Macintosh HD (system files). To fix this, go to Terminal and type 'rm -rf /Volumes/Macintosh\ HD'. Then follow through with the erase. If you want to make sure that nothing on the disk exists after the erase, then choose Security Options and increase as needed. This will erase everything. Then, use macOS Recovery to reinstall macOS.

Good luck!