The quotation you asked about is probably the one one in Act I; Scene 4 of "Macbeth." One of Shakespeare's wonderful tragedies. Duncan is inquiring about the Thane of Cawdor. The king has ordered his execution but he is feeling some guilt about ordering the execution. In scene four we overhear Duncan talking to Malcolm, and he is questioning the disposition of the Thane of Cawdor. Malcolm responds to Duncan with the following quotation:
"Nothing he did in his life
Became him so much like the leaving it; he died
As someone one who had studied his own death,
To throw away the dearest thing he owned
As it were a careless trifle."
This quote may have been used more than once in more of his plays. The quote, "he died." is really too short to completely pinpoint exactly what you are looking for.
Your quotation "he died" can be found in Macbeth(Act I, Scene IV), Here is the full quotation...
Malcolm,"Nothing in his life became him like the leaving it; he diedas one that had been studied in his death to throw away the dearest thing he owed, as 't were a careless trifle".