That would depend on the use case. If you need to look for specific files or data within them, for example because of legal requirements, you can use the built-in Compliance tools and roles, such as eDiscovery. A global admin/SPO admin can also grant himself access to any given site and access all data therein.
Programmatically, you can achieve the same via the Graph API and an application with Files.Read.All/Sites.Read.All permissions. This document is a good starting point: https://learn.microsoft.com/en-us/graph/api/resources/sharepoint?view=graph-rest-1.0