To be fair, had this exact issue with a few client machines last year. The ESU enrollment dialog freezing and closing is usually one of two things.
First, make sure you've got the latest servicing stack update (SSU) installed before trying to enroll, Microsoft won't always tell you that's the blocker but it is.
Second, there's a known issue where the enrollment fails silently if your Windows activation isn't fully verified, even if it shows as activated. Try running slmgr /dlv in an elevated command prompt and check the license status is properly licensed, not just "notification mode."
If that all looks fine, the other thing I've seen work is manually downloading the ESU preparation package (KB5015684) from the Microsoft Update Catalog and installing it directly before trying the enrollment again. Some machines just don't pick it up through Windows Update properly.
One more thing worth checking, if you're on a domain or have any group policies applied, there's a policy under Computer Configuration > Administrative Templates > Windows Components > Windows Update that can interfere with ESU enrollment. Worth having a look if none of the above sorts it.
Let us know how you get on with those steps.