why do i always get hangnails on my fingers?

like on the side of my nails i always get hangnails just little ones and they hurt .. since i was in high school and til now i’m 24 Why do they appear??? and how to prevent them from coming ? my thumb freakin hurts!!