To make Navmesh agents avoid obstacles, there's a component called NavmeshObstacle that you add to the gameobject you want to avoid.