This is a simple way to implement Select2 server-side processing.
Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on and it will manage (install/update) them for you.
composer require samy/select2
Please see Composer for more information.