This is to add to the points made in the first answer to this question. The candle which accompanies Lady Macbeth in her sleep-walking act is functional as a metaphor in different ways. If we take her sleep-walking speech to be a kind of self-confession of the dark deed, the candle may be seen as an image of burning repentance that re-humanizes her character in the final moment of her life. Alternatively, it may also be seen as an infernal image that underscores her predicament of sinfulness.
The candle may well be the actual reason of her death. According to some critics, it might well be that she died due to the fire caused by an accidental fall of the candle.
The candle also cuts across a pathetic image for Lady Macbeth, being her only companion, highlighting her loneliness and Macbeth's neglect towards her. The candle is also a very ironic object. Looking back at her introductory scene, it was Lady Macbeth who had always wanted absolute darkness while now she is reduced to a paranoid obsession with the light of the candle which she does not keep apart even for a moment.
In the scene in question Lady Macbeth enters in a trance with a candle in her hand. She is lamenting the murders of Lady Macduff and Banquo and she appears to see blood on her hands claiming that nothing will ever wash it off. She leaves, and the doctor and gentlewoman marvel at her descent into madness.
Shakespeare creates a black atmosphere through the words used and the fact that this scene is played in complete darkness with the exception of one candle, which Lady Macbeth keeps close by her.
The effect of the scene is to allow the audience to witness the dramatic change in Lady Macbeth from the early scenes of the play. She is now truly mad and her mind flits from one subject to the next. The candle is a representation of the one frail light in the darkness of her soul and the darness which surrounds her. This darkness will engulf her totally and the candle image is also seen in Act 5, scene v.