How to avoid dementia

What are factors that can increase risk of memory deterioration? I’m thinking diet soda, allergy meds and some anesthesia can be a problem

My dad walked/ran a lot but had early onset at 62

His parents had two different forms in their 70s

My grandma never had it and she died at 105