Then when a resolver is asked a question like what is the A record for myserver.com it goes and asks the tld server (.com) what is the NS record for mydomain.com. the tld then responds with the nameserver ip. Then the resolver will query the nameserver directly for the A record of mydomain.com
In practice there is a ton of caching going on here, but that’s the broad strokes
Here is a somewhat simplified explanation
When you are registering a domain you are essentially just creating a NS record:
mydomain.com NS <nameserver ip or name>
Then when a resolver is asked a question like what is the A record for myserver.com it goes and asks the tld server (.com) what is the NS record for mydomain.com. the tld then responds with the nameserver ip. Then the resolver will query the nameserver directly for the A record of mydomain.com
In practice there is a ton of caching going on here, but that’s the broad strokes