Prevent a physics body from being moved through another body

I am sure I am just not searching for the right topics, but I am having trouble with preventing an object from moving through another object (i.e. player controlled object moving through walls). I’ve been able to prevent the player controlled object from moving off the screen, but cannot seem to properly target things like rectangles that exist in the center of the screen.

What is a good way to target those other bodies to disallow the player object to walk through them?

Are you changing the x and y coordinates of the moving object directly or using forces?

If you change the x/y position of an object, physics will not prevent inter-penetration.  Why?  You are in essence bypassing the physics engine.  

Note: If you cause two objects with physics bodies to overlap, by directly assigning their positions, you will get inconsistent and varied responses.

I believe that is the info I was looking for. Yes, I was moving those object by directly changing their x/y coordinates, but I will look into pushing the player object with physics instead. Thanks!

Are you changing the x and y coordinates of the moving object directly or using forces?

If you change the x/y position of an object, physics will not prevent inter-penetration.  Why?  You are in essence bypassing the physics engine.  

Note: If you cause two objects with physics bodies to overlap, by directly assigning their positions, you will get inconsistent and varied responses.

I believe that is the info I was looking for. Yes, I was moving those object by directly changing their x/y coordinates, but I will look into pushing the player object with physics instead. Thanks!