How to distinguigh between 2 times of reading a tags in RFID module RC522

I have trouble solving this case. Example how can the reader read a tag and turn on leds and read again to turn it off and again on, again off. Thanks :)

Maybe have a Boolean variable called say "tagState" and every time you read the tag, go tagState= !tagState; which will toggle it high to low or low to high (the ! meaning "not" or "opposite of"). Then go digitalWrite(ledPin, tagState);

Got it! thank you very much :)