love that question. There are different opinions on this but the most common is that we develop our moral principles through an ongoing series on interpersonal interactions. Bascially, this means that we develop our own sense of what we believe to be ok through experience and meeting people.
Once we have a general approach to morality, we factor in situational factors like pressure, consequence etc. and make a decision (sometimes with much thought sometimes with very little). Hopefully, this will be to do something kind rather than something mean.
Two important points though – (i) it is important that your principles are your own and (ii) we never stop developing these throughout life.