How would u be able to find out if a person entered a number instead of a character and raise an error if they entered a character?

For example u want the person to be able to enter only a number not a letter, how do u know if they entered a letter?

thanks