Anonymize Microsoft 365 usage data is as simple as enabling related feature in the Microsoft 365 Admin Center (Settings –> Org Settings –> Services –> Reports):
Once the setting is enabled, as soon as you browse any usage report in the Microsoft 365 Admin Center you will see user data anonymized. This also applies to the Microsoft 365 Usage analytics or the usage reports in the Teams Admin Center: