SEO falls into three main categories: black hat, gray hat, and white hat. With the black hat, this is the most dangerous form of link building and short-term strategies that may work for a few weeks or months, but is quite likely to get your site banned shortly after.
Gray hat SEO in the middle. The gray hat strategies aren’t as risky, but some are borderline questionable, and the site owner has to decide how far they wish to go with their link building process.
White hat SEO means either no link building at all relying on naturally occurring links coming in or in some cases, people building links they feel are reasonable.
Black hat strategies include hacking into websites to inject links onto pages where the security has been compromised. Doing so crosses the legality mark, and this is why it’s black hat. Other strategies are very short-term typically finding loopholes to exploit to maximize gain until the loophole is closed. Using negative SEO by building links to a competitor’s website using anchor text unrelated to their site like “sex here,” “Viagra free” and other things that Google will dislike is a common tactic.
Gray hat is an SEO process where people buy links from PBN networks and pay for links in various ways. Some people consider any attempt to get a link to be gray hat by default. Other people feel that gray hat is shady link building schemes like PBNs but stopping short of using illegal black hat tactics to rank a page on a site. Most link building for niche sites is the gray hat.
Depending on who you ask, white hat is either no link building on purpose at all, or building inoffensive links without actually paying for it. White hat includes approaching a site to offer a guest post for free in exchange for a link or producing an infographic and getting other sites to publish it and link back to your site. These methods while intentional link building, do not involve paying for the link which is a key criterion.