How do I bake a Tilemap/2D Terrain so that an AI can walk on it?

I made an AI but it doesnt work yet beacuse I cant find how to bake a 2D map, not just some blocks, a portion like a tilemap if its possible.

use 2d colliders, switch to a window>ai>navigation, bake nav mesh, and add nav mesh agents/code to support their movement