https://webkul.com/blog/magento2-create-list-with-pager-in-frontend/
So first you have to check where you are getting collection. Most of time its coming from block and this blog also share how to do it when collection is coming from block.
Now go to your block file and add a _prepareLayout() function. This function render the layout of page as its visible from its name like we can set page title and other things also this function runs automatically.
See below function.
protected function _prepareLayout()
{
parent::_prepareLayout();
$this->pageConfig->getTitle()->set(__('My Reward History'));
// Assuming $macAddress is available, get records for the given MAC address
$blockss_c = $this->getLayout()->createBlock('\Motoris\Vehiclelookup\Block\Cookie');
$macAddress = $blockss_c->get('customer_veh');
$records = $this->getRecordsByGarage($macAddress);
// Use $records to set up your layout
if ($records) {
// Create a unique pager block ID using a counter
$pagerId = 'reward_history_pager_' .


