This can include refusing to run when debugging mode is enabled, refusing to run when running inside of a virtual machine, or deliberately overwriting data. Although some anti-forensic tools have legitimate purposes, such as overwriting sensitive data that shouldn't fall into the wrong hands, like any tool they can be abused.
Secure Data Deletion
Securely deleting data, so that it cannot be restored with forensic methods.
Encrypting data, in order to prevent access to it.
Preventing Data Creation
Prevent the creation of certain data in the first place. Data which was never there, obviously cannot be restored with forensic methods.
Detecting Forensic Analysis
There are methods to detect whether an investigator tries to perform a (live) forensic analysis on the system. A malicious user or program could react to that by destroying evidence, for example.