Does good sleep help fight with bad habits?

Just a simple question

Edit: Thx for useful answers.