Usually it would be to get a new screen installed. That can be interesting with Apple because they make everyone receiving service sign a disclaimer acknowledging that they understand data can be lost. That’s not usually the case, but sometimes they just restore to factory settings to test it or even offer a complete replacement. Also, Apple won’t do s repair unless they can make a device fully functional, If there’s any kind of damage to the case then they’ll probably only offer a full out of warranty replacement.
This is something that third party repair might be able to do where they won’t delete your data. If you’re just going to dispose of the old phone anyways, it might be possible to just ask if a working salvage screen be used to access your data, then removed and reused for another customer. Most data recovery specialists will have them around for severely damaged devices where the only goal is to get data.