How do I use variables from config.ini.php?
As far as I know, you shouldn't be using a "config.ini.php" file for configs in your custom module.

You should have a /examplemodule/config/install/examplemodule.settings.yml file like this:

var_1: "value1"
var_2: "value2"


Then when you reinstall your module, it adds the values.  There's no need to run code in hook_install.

To access the values, use:

\Drupal::config('examplemodule.settings')-&gt;get('var_1');


and to edit:

\Drupal::configFactory()
  -&gt;getEditable('examplemodule.settings')
  -&gt;set('var_1', $value)
  -&gt;save();


You're using state correctly, I tested this out:

\Drupal::state()-&gt;set('var_1', $value);

$var_1 = \Drupal::state()-&gt;get('var_1');