Genesis 20:3

20:3 But God appeared to Abimelech in a dream at night and said to him, “You are as good as dead because of the woman you have taken, for she is someone else’s wife.”

Genesis 20:6-7

20:6 Then in the dream God replied to him, “Yes, I know that you have done this with a clear conscience. That is why I have kept you from sinning against me and why I did not allow you to touch her. 20:7 But now give back the man’s wife. Indeed he is a prophet and he will pray for you; thus you will live. But if you don’t give her back, know that you will surely die along with all who belong to you.”