You just articulated the reason that basically every religion on the planet has a variation of the golden rule.
It's about putting yourself into the other person's perspective in order to understand them better which informs us on how to treat them as they would like to be treated.
If humans were excellent at this, every religion wouldn't be trying to teach it because that would be redundant.