The version requiring the least amount of paperwork is contacting healthcare service to update your in case of emergency contacts. That will get them in the door.
If you have people you wish to be your legal next of kin, find local government and local health service info for
Medical decision maker/shared decision maker
Advanced care directive/POLST
Documented in case of emergency contacts on medical records
Follow advice from local resources about how and where to file these documents. Ensure copies of anything relating to legal next of kin, nominated shared decision makers, care directives, etc. are filed with your primary care physician, local health services, your health insurance, and make sure the people nominated have certified copies. If there's multiple people, email them a copy of the documents together and include each others' contact details so they can coordinate getting a physical copy if needed in an emergency and they're closest/easiest.
Even if you have a great legal next of kin by birth/marriage, it is pertinent to nominate and document if there's people in particular that you trust. If your parents and siblings are likely to bicker, who do you trust most to make decisions for you? If you're in a car crash with your first person and they also can't advocate for you, who's next?
Local legal aid services are another resource for making these documents binding.
For fuck's sake, talk to the people you nominate. Discuss with them your wishes around what to do in worst case scenarios. Document them and review those documents yearly and update when necessary.
If you're wanting to visit someone close to you, the answer to are you immediate family? is yes for visiting. Life pro tip: a cousin can be amongst the closest living relatives while also not necessarily being a legal next of kin or decision maker. Be mindful of reasons why visiting might be strictly limited, but if you're someone's closest inner circle, then yeah, you know how to answer that question; you're family. Be careful about legal next of kin shit when it comes to decision making, tho.
The specifics of all this can vary wildly locally. Your closest legal aid website will talk you through the steps of the processes you wish to pursue.
edited to add: if you have any of these documents or nominations (or are married) and you're still not let in, demand to talk to patient services liaison, ask for their legal team. TAKE NOTES of what they say, as word accurate as you can. If you're forced to be a bit of a cunt about it, do it.