For PS4 disks, all you have to do is insert the disk into your PS5, and it will download to your system storage. Of course, this depends on if you have the disc version of PS5 or the digital.
Despite its age, the PS4 is still a very capable console that's receiving third-party hardware and software support to this day. So if you haven't made the jump over to PS5 yet, don't worry.