Gh is a digraph found in many languages.
In English ⟨gh⟩ historically represented [x] (the voiceless velar fricative, as in the Scottish Gaelic word Loch), and still does in lough and certain other Hiberno-English words, especially proper nouns. In the dominant dialects of modern English, ⟨gh⟩ is almost always either silent or pronounced /f/ (see Ough). It is thought that before disappearing, the sound became partially or completely voiced to [ɣx] or [ɣ], which would explain the new spelling - Old English used a simple ⟨h⟩ - and the diphthongization of any preceding vowel.
It is also occasionally pronounced [ə], such as in Edinburgh.
When gh occurs at the beginning of a word in English, it is pronounced /ɡ/ as in "ghost", "ghastly", "ghoul", "ghetto", "ghee" etc. In this context, it does not derive from a former /x/.
American Literary Braille has a dedicated cell pattern for the digraph ⟨gh⟩ (dots 126, ⠣).
In Esperanto orthography, ⟨gh⟩ can be used when printers lack type for ⟨ĝ⟩ which represents /dʒ/.
In Galician, it is often used to represent the pronunciation of gheada.