Well, if you imagine a simple collision system - say one that could detect a collision between the player, and a level. It would be easy to detect a collision and just simple move the player back to the previous position, in psuedo code:
OPX=PX (Player X position)
OPZ=PZ (Player Z position)
MOVE PLAYER (So PX and PZ have changed)
IF COLLISION(PX,PZ) THEN PX=OPX : PZ=OPZ
Now that's fairly straightforward, but sliding collision works slightly differently. You will have 2 sets of coordinate data, the current and the old - you can cross check to see which axis are affected. Now, this psuedo code would provide sliding collision:
OPX=PX (Player X position)
OPZ=PZ (Player Z position)
MOVE PLAYER (So PX and PZ have changed)
IF COLLISION(PX,OPZ) THEN PX=OPX
IF COLLISION(OPX,PZ) THEN PZ=OPZ
That's not hugely different, you need to check the old positions with the new ones for each axis. There are other methods, like having more advanced collision detection that can calculate the position the player should be in themselves, but this is the bare bones of it. One consideration to avoid the player getting stuck anywhere is to only record the old positions when there is no collision, I won't try and explain that because it might not be relevant, but there's nothing worse than sticky players.
HTH
Van-B
My cats breath smells of cat food.