You've got some good advice already, but one that I'll add here is adopting the principle of charity [0]. Every time someone talks to you, interpret their words in the way that is most favorable to their argument and your mutual interactions. This assumption goes a long way to short-circuiting any negative thoughts you might have about their intentions.
For example, if there seem to be two interpretations of a comment on a PR, one that is genuine and one that is snarky, assume they were genuinely trying to help and reject the snarky version. This is easier said than done, but it's a useful skill to practice.
[0]: https://en.m.wikipedia.org/wiki/Principle_of_charity