The grid below represents your map. Blacker squares are closer to the start. The row at the bottom is the queue you use within the BFS. Initially a start node is added and marked as distance "0". Immediately a marker (shown in yellow) is added to the queue which we will trip across after expanding all distance=0 nodes. Then the first entry in the queue (red squares) is popped off and "expanded". We examine its neighbors and mark them as being +1 from where we are. The expansion nodes are shown in blue, and any that have not yet been visited fly down into the queue for later work. When the yellow marker comes up we know we've finished all the nodes at a given distance and so we increment the distance and put the marker back at the end. When we find the marker and nothing else we are done.
One example is a totally open map. The other has obstacles in purple to show what happens when you run the BFS near water.

