Oh God, this is stuff you have to learn by intuition, i will never remember all these rules
Locative vs Instrumental.
So for example "about her" = "o niej", but "with her" = "z nią".
In past and future there is : I, you singular - feminine vs masculine he, she,it- feminine vs masculine vs neuter (needs to agree with GRAMMATICAL gender - osoba szła/ człowiek szedł)
we, you plural, they - masculine personal vs not masculine personal (one masculine person in a group, makes a group masculine personal, one masculine noun + one personal noun (ex. girl and dog) makes a group masculine personal)
and that is why you need to know people's gender when talking to them, It's easy to avoid gendered pronouns, you can avoid adjectives but avoiding past and future verbs is impossible
EDIT - as @mihxal poited out I eas not right, you can avoid gender with future tense, but you cannot avoid it in past tense
That’s because those past forms are contractions of old adjectival past participles (that, in many cases, are no longer productive) and present tense to be. Eg. Pomyślałaś was something like Pomyślała jeś (= you are the-one-who-thought). And because Polish adjectives must agree on gender with what they describe, also does this past tense.
Some of those participles are in use currently as adjectives with related meaning (eg. były, była = ‘former’, oszalały = ‘crazy’ – in Old Polish they just meant one-who-was and one-who-got-crazy).