Collision and movement problem

Hello,

The movement of my character is based on constantly modifying its position. It works ok for the most part, but when I try to move into another object, my character stars to enter the body of the second object, but expected behavior is for the bodies to remain separate.

The resulting behavior can be noticed here: https://i.imgur.com/xKSwKON.png

As you can see, my character is inside the brick’s body. I want to keep them totally separate. I tried it with detecting collisions and constantly modifying character’s position, but it sometimes fail and they overlap anyway.

Is this form of movement bad and should I change it? I prefer not to. I am looking for any solutions.