Need a hello world of select2 example for remote data

I am trying to build a simple website for which I was trying to integrate select2 plugin. However there is no easy template or documentation for simply using the plugin. Unless I spend upwards of a half a day, I don’t see how I can use this plugin.

Does anyone have a remote data sample code?

Data format: https://select2.org/data-sources/formats
Using the ajax setting: https://select2.org/data-sources/ajax