HitTest

Can someone help me make a code for hitTesting, so thast when my character in my game hits a wall, he stops?