Initialize a counter for the number of islands to 0.
Iterate over each cell in the grid.
If a cell's value is '1', increment the island counter and call DFS on that cell.
In DFS, mark the current cell as '0' to indicate it has been visited, then recursively call DFS on all adjacent cells that are within bounds and have a value of '1'.
Continue the process until all cells in the grid have been visited.