I think I offered this same advice previously on the forums (maybe in response to one of your posts), but I’ll mention it again here.
From what you posted, it seems that for the purposes of collision detection and response this is a 2-d environment represented by a regular grid, where (for the purposes of collision) grid cells are either empty or fully occupied.
One response you may get is to use an existing physics library, such as Box2D. That would be a fairly heavyweight solution for simply moving around in a grid-based environment, although if there are going to be other moving entities, a physics library would probably make things easier.
If you want to do it yourself though, fortunately this is one of the easier collision-related problems to solve. I would recommend though that if your player position refers to a corner of the player, you change it so that the position refers to the center of the player, as this will make things a lot easier. (I’m not entirely sure how you’re doing it currently, but I think sometimes when people get used to working with certain sprite-based frameworks they tend to anchor sprites in the corner rather than the center, even though this can be somewhat inconvenient as far as the simulation goes.)
I think the simplest thing you could possibly do is as follows. Represent your player as a circle. If the circle intersects an obstacle (the obstacles being squares representing occupied cells), compute the minimum translation vector that will resolve the collision, and move the player accordingly. As long as the player circle is smaller than a cell and as long as displacements aren’t large enough that tunneling might be an issue, this should give you good results, including natural sliding behavior.
If you want to pursue that I can help you with the math (which is simpler than you might expect). Or, you could always go with e.g. Box2D if that seems easier.