Build a table of small primes, and check if they divide your input number.
If the number survived to 1, try pseudo primality tests with increasing basis. See Miller-Rabin primality test for example.
If your number survived to 2, you can conclude it is prime if it is below some well known bounds. Otherwise your answer will only be "probably prime". You will find some values for these bounds in the wiki page.