What is type 1 and type 2 diabetes and how do you get it?

i’ve heard that there are 2 types of diabetes but how do you get diabetes?