Typically when people think about navigation they think about path finding and for the most part that's correct. The term navigation applies to a wider range of things but the data structures needed are generally the same.
Let's take a look at the structure for the navigation cell:
Flags are set by grid entities like walls, buildings and doors. Walls and terrain tiles will typically set the navigation flags to fully blocked while doors will block navigation on their sides and allow navigation through them. While flags are easy to set, they are not particularly easy to use. For instance, let's say a navigation agent wants to travel in the North-West direction. This can be blocked by either a North flag or a west flag. A better way to do this is to use a byte, which happens to have exactly 8 bits that we need for the navigation directions, 4 cardinal and 4 diagonal.
To transform navigation flags to the neighbours byte we first need to gather all the flags around each cell. Since we don't want to allow navigation outside the map we consider cells outside it as blocked:
Now we go through each direction and check if the flags are set. Navigation is blocked if either the current cell or the neighbour cell has a flag to block it. This ends up being easier for cardinal directions since we only have two checks. For instance when we check navigation to the west direction, we need to check the current flag for the west flag and the west neighbour cell for the east flag.
In order to do path finding on a grid we start from a point and then expand towards the target position. Expanding is done using a frontier that's typically implemented as priority queue with the priority defined as the heuristic between the start position and the end position, in this case just the diagonal distance. There are multiple heuristics that yield interesting results and I strongly suggest reading further into this for people who are interested. Without using a heuristics function we end up with what is called a flood fill which can be very useful if we don't know the position of what we're searching for.