How do I prevent having athritis later in life like my grandma?

Exercise avoid injur. You are genetically at higher risk for arthritis if your parents or their parents have it. There have been several genes isolated now coding for arthritis. You can't change your genes yet, but, you can keep your weight down, avoid knee injuries, keep your muscles toned with regular exercise, & proper nutrition and water intake are key for all cells.
Cannot. Your grandma probably had degenerative arthritis which is genetic. You may not get it because it is not passed on to everyone. But you may and there is no way to prevent it that we know of.