We use hear for sounds that come to our ears, without us necessarily trying to hear them!
For example, ‘They heard a strange noise in the middle of the night.’
Listen is used to describe paying attention to sounds that are going on.
For example, ‘Last night, I listened to my new Post Malone CD.’
So, you can hear something without wanting to, but you can only listen to something intentionally. An imaginary conversation between a couple might go:
‘Did you hear what I just said?
‘No, sorry, darling, I wasn’t listening.’