These links can be helpful:- http://wpdean.com/wordpress-affiliate-link-cloaker-plugins/ https://bloggerspassion.com/affiliate-link-cloaking-plugins/ https://wordpress.org/plugins/simple-link-cloaker/ https://wordpress.org/plugins/simple-link-cloaker/
There are a ton of cloaking plugins available on wordpress. Just type it in the search and sort by reviews.
Here is another article with some useful plugins https://www.begindot.com/best-affiliate-link-cloaking-wordpress-plugins/
You can also do it without plugins. Just use this code: <html><head><title>A web page that points a browser to a different page after 2 seconds</title><metahttp-equiv="refresh"content="2; URL=http://yoururl.com"><metaname="keywords"content="automatic redirection"></head><body> If your browser doesn't automatically go there within a few seconds, you may want to go to <a href="http://www.google.co.in/">the destination</a> manually. </body></html> Edit the two bolded urls and paste your aff url. Paste it to a blank index.html file and save. Next, create a new folder with a name suggesting where the redirection goes, like 'hostingcompanyX'. Put a file into a folder. On your website's main folder (on your FTP) create another folder, like 'links'. Upload first folder to the new FTP folder. Done. How to use it? All you have to do is to paste a link on youw website that looks like this https yourdomain/links/hostingcompanyX Repeat the procedure for every affiliate link you want to cloak.
Use pretty link plugin this its very good and its also offers you detailed stats .In your wordpress dashboard go to plugins and search for pretty link and instal it