With Geometry Nodes there are basically two ways (probably more?), first of all depending on if you are using the original geometry or have geometry generated by the Geometry Nodes nodetree. I'm making a simple example with only three materials
Original geometry:
The second method below would work here, too, but this one works like this only with the original geometry from the Group Input.
Let's you have a sphere object which should show the different materials. This sphere has three materials, the slots have the indices 0, 1, 2. If you now add a new Geometry Nodes setup, you can use a Set Material Index node to decide which material the object should show.
Plug a Scene Time > Frame node into the Index input and the material changes per frame. (I subtract 1 because the index always starts with 0, but my frames start at 1.)
Generated Geometry:
In this case, the generated geometry like this Mesh Primitive > Cone does not automatically gets any of the materials of the original geometry assigned - this has to be done with a Set Material node.
This also means, the indices of the material slots have no effect. To have materials to choose from you can use an Index Switch node set to Material. To get enough slots you can click the Add Item button in the sidepanel.
Then you can select materials for the empty slots. The good thing about this method is (which would also work with the original geometry as mentioned above), it does not need all materials on the original object. As long as they are in the scene, they can be selected here.
The result for both setups (apart from one being a sphere, the other a cone) is this: