Use class \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory for loading customers collection. Method addAttributeToFilter for filtering

protected $_customersCollection;
....

public function __construct(
    \Magento\Customer\Model\ResourceModel\Customer\CollectionFactory $collectionFactory

  ) {
    $this->collectionFactory = $collectionFactory;
    
  }

....

$search = 'data to search';

$this->_customersCollection = $this->collectionFactory->create();
$this->_customersCollection->addAttributeToFilter(
          [
           ['attribute' => 'email', 'like' => '%' . $search . '%'],
           ['attribute' => 'firstname', 'like' => '%' . $search . '%'],
           ['attribute' => 'lastname', 'like' => '%' . $search . '%']
          ]);