This advice comes from Polonius to his son Laertes in Act I, Scene III of 'Hamlet.' It's part of a longer speech about proper conduct and wisdom, cautioning against financial entanglements that can damage relationships. The speech continues with 'This above all: to thine own self be true.'