When you find human society disagreeable and feel yourself justified in flying to solitude, you can be so constituted as to be unable to bear the depression of it for any length of time, which will probably be the case if you are young. Let me advise you, then, to form the habit of taking some of your solitude with you into society, to learn to be to some extent alone even though you are in company; not to say at once what you think, and, on the other hand, not to attach too precise a meaning to what others say; rather, not to expect much of them, either morally or intellectually, and to strengthen yourself in the feeling of indifference to their opinion, which is the surest way of always practicing a praiseworthy toleration. If you do that, you will not live so much with other people, though you may appear to move amongst them: your relation to them will be of a purely objective character. This precaution will keep you from too close contact with society, and therefore secure you against being contaminated or even outraged by it. Society is in this respect like a fire—the wise man warming himself at a proper distance from it; not coming too close, like the fool, who, on getting scorched, runs away and shivers in solitude, loud in his complaint that the fire burns.
From Counsels and Maxims by Arthur Schopenhauer (translation by T. Bailey Saunders).