This quote is found in Act V, scene 5 of Macbeth.
The entire quote, "All our yesterday have lighted fools the way to dusty death. Out, out, brief candle! Life's but a walking shadow, a poor player that struts and frets his hour upon the stage and then is heard no more," is Macbeth's comment on life and the "players" who walk the stage of life--a lovely metaphor. He and his wife are two of those players. Her life, ended much sooner than it should have, is the "brief candle"--the candle and her life have been extinguished.
He says that we all "strut and fret" upon the stage of life and then die--"are heard from no more." Lady Macbeth's fretting and strutting are over...the curtain has closed, the candle is out.
Macbeth is busy when he hears the news of his wife's death, so he doesn't pay much attention to her death. It can be viewed that he is cold and heartless at this point in the play, or that he is rationalizing his grief by putting it in context with the battle for which he is preparing at the time he receives the news of her untimely demise. He does, however, realize the pointlessness of his ambition and how her candle (life) has been unnaturally shortened and in all probability, his candle will also soon be snuffed out. Had he been patient and not "stirred" the pot to make his ambitions and goals a reality, they would have lived longer, more fulfilling lives.