Michel De Montaigne said this quote

From books all I seek is to give myself pleasure by an honourable pastime: or if I do study, I seek only that branch of learning which deals with knowing myself and which teaches me how to live and die well...