An efficient way to use Extbase Pagination in your custom extension, inspired by blog entry from undkonsorten (in german):
https://blog.undkonsorten.com/native-pagination-in-typo3-10
Add PHP class PaginationService
to your extension:
Fx \Vendor\MyExtension\Service\PaginationService