If you have a list or a library in a SharePoint site that you want to show in a webpart, this is simple if the list is in the same site, or the document library is in a child site, but not if the library is in a separate site collection.
To be able to see libraries across multiple site collections, there are a few options; one is to create a SharePoint web part in Visual Studio and establish a connection to the library that you want as your source and then iterate through the library object writing some code to the page to show file names and other properties.
This can become a quite long-winded process so there are some solutions available both for modern and classic SharePoint sites.
For a classic templated site, you could add a page viewer web part and point it to a page with the list / library web part on it. Alternatively, you can enable cross site searching and use a Content Query web part.
On a modern site you will need to incorporate a hub site, then you can use the highlighted content web part to roll up documents from a library (or all libraries) across your hub. This web part allows for advanced filtering and different ways to view your items.
At Dolphin Solutions we have created a range of bespoke web parts to roll up libraries & lists on a page. If would like further assistance, please contact us.