“Yahweh visited Hannah.” Yahweh had intervened and blessed Hannah so she got pregnant. It does not mean Yahweh was somehow personally present but rather that Yahweh “visited” through the circumstances of Hannah’s life.
[For more on God “visiting,” see commentary on Exod. 20:5.]