Every DNS record carries a TTL. A resolver that has fetched the record answers further queries from its cache until the TTL expires, and only then asks the authoritative server again.
High values (3600 to 86400) reduce load on the name servers but slow down changes. Before a migration, lower the TTL in time, for example to 300 seconds, at least one old TTL period before the switch. Raise it again afterwards.
Common misunderstanding: the TTL is lowered on the day of the move. Resolvers that cached the record with the old 24-hour TTL keep serving the old IP for another day.
Example
dig example.com A +noall +answer