Sin crouches at the door
Here’s what it means
Sin is pictured like a predatory animal waiting to master Cain.
Why the Bible says it this way
The Bible sometimes describes a thing, place, or idea as if it were a person so the point is easier to picture.
A helpful detail: The warning treats sin as an active danger while still holding Cain responsible to rule over it.