Luther knew, probably from both his own experience and pastoral conversations, that prayer happens in the midst of darkness, both the darkness of night and of despair. Commenting on Gen15:5,the story of Abraham questioning God’s promise and God responding by telling him to number the stars for “so shall your descendants be,” Luther writes: The fact that Abraham is commanded to look at the stars is proof that this vision occurred at night, at a time when Abraham was sighing and lamenting. It is characteristic of sublime trials to occupy hearts when they are alone. For this reason there is frequent mention in Holy Scripture of praying at night and in solitude. Affliction is the teacher of such praying. Thus because Abraham was occupied with these sad thoughts, he was unable to sleep. Therefore he got up and prayed; but while he is praying and feeling such great agitation within himself, God appears to him and converses with him in a friendly manner. Luther thought prayer in distress was absolutely crucial and a necessary exercise of faith.
Practical Advice on Prayer from Martin Luther MARY JANE HAEMIG