How can i get neighbor / adjacent grids on a grid map

How can i get the neighbors of a certain grid in a for example 10 by 10 grid map?