First, what kind of sensors are you using. Give us some information of your setup and more details about what the robot (I'm assuming it's a robot) should do.
Finding a wall is really easy actually, but it depends on what sensors you are using. For example, if you are using a Sharp IR range sensor, you only need to read the value from the sensor. If it reads above the certain distance you want your robot to keep, them you've find the wall. If you have a sensor that gives either 1 or 0 it's even easier.