If you have a Mac that has been rebuilt because it was infected with a virus or malware, and you want to restore your files using Time Machine, restore ONLY the user profiles and applications. DO NOT restore system files or library files – they can re-infect your Mac with malware, which will result in your Mac being quarantined again.
The user profile holds your data files, but it may also hold some files dropped by the virus or malware. First make sure your OS is up to date - How to update the software on your Mac). You should also install antivirus software for the Mac to help protect your Mac and your data: recommended antivirus software
If you use another backup tool for your Mac, use caution when restoring anything other than your data files; you may re-introduce the infection to your Mac. Check the vendor's information for help on backups and restores.