The quote was not meant by Shakespeare the way people use it. People usually use this line from Hamlet to represent integrity and healthy individuality, when in actuality Polonius was entirely selfish and what he’s really saying to his son is “Screw everyone else. Put yourself first, do what you want, and don’t worry about what other people might need or want.” https://wordynerdbird.com/2019/09/01/misunderstood-shakespeare-to-thine-own-self-be-true/