The collision depends very much on how the player is allowed to move. For example if you would let player to move freely in 360 degrees you'd have a very different collision algorithm, than if player can only move vertically or horizontally.

There is not 1 way to make collision but 1000 different. For example:
1) Before movement, save character's full position in temp variable. If player collisions, simply copy the old position to current position.
Problem: If tile width is 32 and player is allowed to move in odd steps of 3.0812 for example, then player will never actually touch the wall but collide little outside different on each wall. Solution, move player by number that is divisible to 32.

2) For each 4 directions (up, down, left, right), if player is moving down and hits wall:
- Move player backwards by as much as he moves per frame.
or
- Count where player should be when it is exactly outside of collision range. For example if player is moving right and hits left wall, then PlayerX := WallX-PlayerSprite.Width