The core mechanism is interception. You sit a proxy, API gateway, or reverse proxy between clients and the monolith. Tools like NGINX, an AWS Application Load Balancer, or an API gateway match on path, header, or hostname and forward each request to either the legacy backend or a new service.
A typical rule looks like: send any request to /checkout to the new checkout-service, send everything else to the monolith. As you migrate more endpoints, you add more rules. Because the routing is data driven, you can move one endpoint at a time and roll it back instantly by changing a single rule if the new service misbehaves.
The hard part is shared data. The monolith and the new service often read and write the same database tables during the transition. Teams handle this with a shared database for a while, an anti-corruption layer that translates between old and new data models, or change data capture and dual writes to keep both copies in sync until the legacy store can be retired.