Collisions help

how would i make an oblejct stop once it hits another such as a game sprite not walking through a wall or not falling through a platform?