Getting a US green card starting as an international student

I’m planning to pursue my master’s in the U.S. as an international student and eventually want to get a green card later on. Can anyone explain the process after graduation? How long would it take(the total number of years)overall to get a green card?Should I come to the US? Will it be worth the shot? Thanks in advance!