Can you call a method from the script of all instantiated prefabs of a cetain object?

I am currently trying to recreate chess and the problem I am having is that I need to instantiate all of the pawns in a loop (I could write it out but it seems inefficient) and I need to be able to call a method from all of the pawns to look for a check (I’ll probably use raycast but I haven’t gotten to that yet). How can I go about calling the method that looks for checks from all of the instances of the pawn?

I’m pretty new to unity so please go easy on me if I said something dumb