My grandmother is getting hit hard with dementia. It's not to the point where she is forgetting everything, but she's extremely irritable, not remembering random words (this during almost every conversation I have, not just a one-off thing), forgetting how to do simple tasks like replying to an email, and getting upset at things that are trivial and/or pose a health hazard (ie, throwing out rotten meat, not wanting to eat spoiled food, making colourful bracelets, etc).
Note that I'm really not good at IRL social cues and shifts in attitude. I didn't even know my grandma was beginning to spiral into dementia until my mother pulled me aside and had a talk with me this morning. I've been getting into arguments with her about extremely random things not knowing that she's struggling with this, so I feel really bad now.
I'm leaving for college in the near future, and I want to be there for her while I am still with her, because I know that when I see her next, her condition will be much worse. However, again, as someone who really doesn't pick up on what is her clear thoughts and what is just the irritability and mood shifts that come with dementia, I have no clue on what to do.
Do any of you guys know how to deal with or be there for someone who has dementia? Or how to not be as angry/argumentative towards them? (Sometimes the things that she is irritable about are a hazard to me and my family and we've gotten sick because of it, and I am not sure how I can explain to her that it is not safe without making her become sad for no reason.)

two things awe me most: the starry sky above me, and the moral law within me"