magento2 – How to add CSS that works only in Checkout page Mangento 2.4.2

If CSS is merged then, that merged css will call in all page. Otherwise, you can add css in checkout_index_index.xml file :

<head>
        <css src="https://magento.stackexchange.com/Magento_Checkout::css/customcheckout.css"/>
</head>

File should be available on

app/design/frontend/VendorName/ThemeName/Magento_Checkout/web/css/customcheckout.css

And in css file add .checkout-index-index class before all css’s class name. So, that css only apply on checkout page.

Suggestion : Instead of create css file. Add css in less file.