Checkout UI extension add external JS for cookies and consent

I want to add custom JS on checkout page using checkout UI extension. How can I achieve it?

This is a custom JS for cookie consent banner and we have to use this JS as our organization follows that. So please let me know how we can achieve it. Shopify support redirect all technical things to community. If here you also say not possible then I have to escalate it.

You can create a custom UI Component and then using Extension Target you can place it near footer.
In this UI component body add Script tag.
https://shopify.dev/docs/api/checkout-ui-extensions#extension-targets

Alternatively you can also try to customizing the footer UI component if the third party script is simple?

https://shopify.dev/docs/api/checkout-ui-extensions/unstable/targets/footer/purchase-checkout-footer-render-after