First of all, let's figure out in which case you might want to hide your link from search engines:
-to manipulate link juice distribution within your website to prevent it's distribution to unimportant pages like filters or footer links.
-to keep link juice on your page while linking to another site.
-to hide links you don't want search engines to know about (e.g. referral links)
Probably, there're many other cases but these are the most common ones.
So there are three the most widespread ways to prevent indexing of the link on your site:
-Setting nofollow to a particular link. It's the first and the easiest way that comes to the mind when you don't want to transfer link equity to the target page you are linking to. But the thing is that this method neither transfers link equity to the target page, nor keeps it on your page, it simply burns it. *POOF*, gone.
-Another way is to use Java script to hide your links from search engines. I'm not a big fan of Java script, so I can't tell much about it, but the thing I know for sure is that Google already knows how to dig deep into it. Thus there is no guarantee your links will remain undetected. However, some complicated scripts might still work.
-I've also seen people setting noindex on the target page or disallowing it in the robots.txt when they want to prevent link juice distribution to unimportant pages. For instance, one guy who asked my help disallowed all pages in the footer because he wanted to keep link equity within his important pages. But once again, it simply vanishes if you do like that.
That's where it comes to the technique I wanted to tell about - Post/Redirect/Get. I haven't found any solid piece of info about PRG in SEO (would be glad if you share some in comments), but after reading about it on Wiki and watching some videos you should understand how it works.
POST requests are used to send data you enter in different web forms (for example, when purchasing something or logging in) to the server. Search robots never use them making it an ideal way to hide your link.
How it works:
1. A web form (a button) that sends a POST request containing the URL you want to redirect to is created instead of an ordinary link.
2. The server gets it and redirects you.
3. Browser is sending another request (now it's GET) to get the data of a new page.
That's it! You'll also need to make your button look like an ordinary link using CSS.
This method allows to hide any links you don't want to be seen: affiliate links, footer links, filters etc.
I wish I could cover technical details of this method, but I simply can't find any examples through the web. I'll add a link to a decent source as soon as you share one. I know there are many SEOs here who definitely know about this method, so what are your thoughts about it?