Another Algorithm for prime number

I want to know another algorithm for checking input a prime number because in the algorithm shown in the lecture it will take so much of the time if the number is large as we have to check every number before the input number. so can you please tell me another method.

One possible approach:

  1. Check divisibility by small primes up to, say, 5,000. This finds the easy ones.
  2. Optionally, run a single Fermat test, base 2. This will eliminate some more composites at less cost than a Miller-Rabin test.(you can google these tests but these are part of competitive coding )
  3. If the number is not yet flagged as composite then run repeated Miller-Rabin tests to the level of accuracy you need. If you run 64 tests then the chances of an error are less than 1 in 2^128.