To be clear because the title is slightly ambiguous: I understand that to check for collision detection it's (box.x > otherBox.x && box.x < otherBox.x + otherBox.w) etc.
However I'm curious about things to do after this, how can I sort of keep the player from entering the other object that they're supposedly colliding with without fully stopping them and therefore suspending them from movement?