You can cloak affiliate links in WordPress using plugins like ThriveAffiliates and Pretty Links. Both plugins cloak your real affiliate link by replacing it with a "pretty" link that includes your domain and a prefix to help visitors know beforehand where they'll be redirected to.
Cloaking affiliate links is a good practice because it makes your referrals trustworthy in the eyes of customers and also hides your affiliate ID from malicious bots.