White Hat SEO - by following and applying guiedlines of Search engine optimizations.
Black Hat SEO - by trying to focus on search engines algorithem weaknesses to rank the page higher, usually search engines updates their algorithmes to fight Black Hat SEO, which leads to impact the rank negativetly for the sites that uses such methods.
Mainly there are two types of SEO White and Black hat. White hat SEO is the ethical way while the Black hat is unethical. There is another SEO type which is Gray hat seo. Gray Hat seo is between the White and Black hat seo.
If search engine find a website which is using Black hat the website can be banned, but in a gray hat seo the result could be a penality.