Yes, the *language_manager* service can give you a list of available languages for which you can get the corresponding language ID, as said in the other answer.  
Just don't access the [`LanguageManager`][1] class directly because a module could have replaced the *language_manager* service implementation with an implementation done from a different class. If you were to use the `LanguageManager` class directly, you would use the wrong class.

Since you are letting the users select a language from a form, instead of using a *textfield* element, you should use a [*language_select*][2] element as in the following form builder code.

      $form['selected_langcode'] = [
        '#type' => 'language_select',
        '#title' => $this
          ->t('Language'),
        '#languages' => LanguageInterface::STATE_CONFIGURABLE | LanguageInterface::STATE_SITE_DEFAULT,
        '#default_value' => $config
          ->get('selected_langcode'),
      ];

Using that form element, the submission handler would get the language code for the language selected from the user with `$form_state->getValue('selected_langcode')`.

For more details about the form element, you can read [New language_select element in the Form API][3]. For practical examples of uses of the form element, you can look at the [uses of the *language_select* element][4].  
In particular, you could be interested on how to show a full list of languages, instead of a list of languages set in the site. The following code would do that.

      $form['selected_langcode'] = [
        '#type' => 'language_select',
        '#title' => $this
          ->t('Language'),
        '#languages' => LanguageInterface::STATE_ALL,
        '#default_value' => $config
          ->get('selected_langcode'),
      ];

For a full list of available constants, see the documentation for [`LanguageInterface`][5].


  [1]: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Language%21LanguageManager.php/class/LanguageManager/8.6.x
  [2]: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21LanguageSelect.php/class/LanguageSelect/8.6.x
  [3]: https://www.drupal.org/node/1749954
  [4]: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Render%21Element%21LanguageSelect.php/class/element_invokes/LanguageSelect/8.6.x
  [5]: https://api.drupal.org/api/drupal/core%21lib%21Drupal%21Core%21Language%21LanguageInterface.php/interface/LanguageInterface/8.6.x