People will say the wrong thing. Not because they're cruel - because death frightens them, and frightened people reach for the nearest sentence. The nearest sentence is usually terrible.
When they say "everything happens for a reason"
You can say: "I don't find that comforting, but I know you mean well." You can also just say "mm" and change the subject. You do not owe anyone a philosophy debate about your person.
When they say "at least…"
"At least she isn't suffering." "At least you had forty years." Any sentence that starts with "at least" is trying to shrink your loss to a manageable size. It isn't manageable. You can say: "There's no 'at least' in this for me yet."
When they say "you're so strong"
Often this means "please don't fall apart in front of me." You can be honest: "I'm really not. I'm just upright." Or take it as intended and let it go. Both are allowed.
When they say nothing at all
Some people will cross the street to avoid you. It stings like a second loss. Mostly it means they don't trust themselves to speak - it's about their fear, not your worth. The ones who stay and say clumsy things are usually the ones worth keeping.
You're allowed to protect yourself politely. You're allowed to protect yourself impolitely. Grief doesn't come with a hospitality requirement.