Most people are familiar with the saying, 'Do unto others as you would have them do unto you.' This is sometimes called The Golden Rule. Some people interpret this as meaning do nice things to others so they will do nice things to you in return. I believe it means treat others with respect and kindness because that is how I like to be treated. I also believe it is simply the right thing to do and I feel better about myself for acting in this way. I interpret the saying in general terms because once you start to get specific, different people have different likes and are comfortable with different actions.
To give just one example of a specific action, some people like hugs and others are uncomfortable with such close contact, especially if they aren't very familiar with the person offering the hug. In some cultures hugging is a big thing. Other cultures aren't into hugging.
To hug or not to hug can vary with the age and sex of those involved. Class differences and when you were growing up or the time in history has an influence. Some people are physically very sensitive to touch and a hug may actually cause a degree of pain.
What I am trying to get at is, even though I love to receive a hug from someone I am comfortable with that doesn't mean everyone else feels the same way and I need to respect that. I also shouldn't feel offended if another person doesn't welcome my offer of a hug even though we get on well. They are not rejecting me.
Sometimes we can work out if we should do or say something by considering how we would feel if we were on the receiving end. However, there are many times it isn't that simple. Sometimes we need to ask the other person how they would feel rather than assuming we know the answer.
I do think it is possible to overthink every action and then end up not doing nice things or offering a friendly comment because there is the chance the other person won't appreciate it. I guess it is a matter of getting a balance between assuming everyone else feels the same way we do and the other extreme of worrying excessively.