Formation of negative hydrogen ions in surface and volume processes