How does config.js work and how to set it up?

Yes, it is helpful.
I still am not able to understand how to use the config service and how can we store the configuration a user selects and retrieve the config when loading the extension.
Could you please help me with this?