This is a very legitimate question. The questioner assumed that in Noah's day, the earth's landmasses were arranged as they are now. But according to Scripture, that was not the case.
One landmass
In the beginning, the entire land surface of the earth was one connected mass: one vast continent surrounded by water. This aligns with the scientific concept of Pangaea, which is consistent with the biblical account. In Genesis, when God separated the land from the water, the seas became one body, and the land became one body, essentially a single "supercontinent."
It was only in the days of Peleg that "the earth was divided" (Genesis 10:25). Many believe this refers to a massive geological event, possibly a great earthquake, that began the separation of the continents into the shapes we recognize today. This explains why, for example, the coastlines of South America and Africa appear to fit together like puzzle pieces.
Importantly, this division of the earth's landmass happened after the Flood, which took place much earlier (Genesis 5).

One language
Another factor that would have made communication easier in Noah's time is that the whole earth spoke one language. The diversity of languages only came later, during the events surrounding the Tower of Babel (Genesis 11), well after the Flood.
Far fewer people
Finally, the population of the earth in Noah's day was far smaller than it is today. Fewer people, one landmass, and one language would have made it far easier for Noah's warning about the coming Flood to reach everyone.
This answer was first written as a reply on X: x.com/EfosaAdun.