You’ve probably noticed when buying on ecommerce sites that when you enter the checkout flow it feels like you're in a different version of the site. It should be much more stripped back. The header loses a lot of its links, the site-wide navigation disappears, and the footer links go to be replaced with just basic copyright and legal notes.
The links should be reduced on these pages because you don't want users getting distracted when they're in the checkout flow. This is a key point of the journey where they've expressed a strong interest in buying, so make it as easy as possible for them to do that. If they suddenly spot a new product on the navigation they may go off hunting, read about this new product, compare it to one on another site, and forget to convert with you.
People ask if there should be *any* links at all, and I've seen checkout flows with a few but I've tended to design them with none, other than ones to other checkout steps. This includes stripping the link to the homepage from the logo. It just makes things clearer and more focussed. If the user wants to leave there's always a browser back button or they can close the window altogether.