How does hackers get thousand of email adresses?

Hi !
I’m wondering how does hackers get thousand of email adresses. I just wanna know what type of attack they do or how they do it.
Thx for the help !