Your hair can go from straight to curly if you have the curly hair genes and other people in your family have naturally curly hair.
Sometimes the curly hair happens when the person is a kid or toddler but other times a persons hair can stay straight until they hit puberty or a little older and then it can suddenly change to curly vs straight hair.
But you have to have the curly hair gene in your body to have your hair suddenly change to curly from straight hair.