Then God asked Cain why he was angry and why his face was downcast.
God told him if he did what is right, he would be accepted. But if he didn't do what is right, sin is crouching at the door desiring to have him, but he must rule over it.