Baltasar Gracián said this quote

One should cultivate good habits of memory, for it is capable of making existence a Paradise or an Inferno.