Essentially the expression is offered to to speak you do what you must convince yourself the you have no factor to save yourself awake worrying about terrible things you've done.
Hard to describe so I'll give an example.
A male kills a bunch the people. In theory, he must lie wake up tossing and transforming thinking about all the lives he took and also the horrible things he did. But what "lets the sleep at night" is that he tells self the human being he killed were evil and also he to be doing the people a favor.
Essentially it means come up with whatever excuse you should clear her conscience and also absolve yourself of any kind of wrongdoing (in her mind).
It's "whatever helps you sleep in ~ night" and also it's a speak to Out that that person is simply using justification and also you see ideal through it.