Here's one way. Let's say your location of interest is at position (x,y). You can write a function (or method) called CheckTile and pass it the position to check. Then you can write your check logic something like this:
CheckTile( x-1, y ); CheckTile( x, y-1 ); CheckTile( x+1, y ); CheckTile( x, y+1 );
Remember to make certain the position passed into CheckTile is valid - negative coordinates are not valid for example. If you need to check the adjacent tiles at 45-degree angles also then those would be at positions (x+1,y+1), (x+1, y-1), (x-1,y-1), and (x-1,y+1).
This is just a basic algorithm. You will likely need to pass more parameters and return something useful from the function.
To do what you described then order the search in a way that makes sense and return when the first one is found. For example, you could check in a clock-wise direction beginning with the one above. The key is to write very basic functions that you can easily arrange to make the logic work the way it needs to.