Imaam Ahmad (rh) was asked, when will you rest? He said, when my first foot is in Jannah.
You won’t gain anything from knowledge and leaving a legacy until you tire yourself out as a scholar of the past mentions in Sahih Muslim that knowledge cannot be gained through ease of the soul!
Mua’dh (may Allah be pleased with him) said: “I sleep and I get up (to pray at night), and I seek reward from my sleep just as I seek reward from my getting up (to pray).” [Bukhari 4088]
A scholar of the past said: “What this means is that he sought reward by resting just as he sought reward by striving, because if the intention in resting is to enable one to do acts of worship, one attains reward.”