How do you get the diagnostic code on a 1998 Jeep Grand Cherokee when the check engine light is on?

With an OBD2 scan tool. or flip switch till odometer comes on repeat two times watch for code done means no codes