Check each axis of the two rectangles to see if either overlap. If so, separate by either the minimum axis of overlap or by some heuristic based on the direction of travel.
This is pretty simple, what exactly are you having trouble with detecting and resolving axis-aligned rectangles?
We got the rectangles working now its just making the player stay on top of the block. I currently have it reset the Y position of the player to a constant part of the map but how can I get it so the players position will be set to the top of the block?