Hello Patrick, you’ve given me a difficult question to answer because there is a rule about pronouncing ‘g’ but, typically with the English language, there are many exceptions to this rule!
The pronunciation of ‘g’ generally (but not always) depends on the letter that follows it. The general rule is this: if the letter after ‘g’ is ‘e’, ‘i’ or ‘y’, the pronunciation is a ‘soft g’ as in ‘fringe’. Some examples of words with the soft ‘g’ are:
general, giant, gymnastics, large, energy and change.
Any other letter that follows requires a ‘hard’ pronunciation of ‘g’ as in ‘progress’ and some more examples are:
golf, pig, great, grasp and gum.
A bit of extra info for you: if a word derives from German, it’s usually a hard ‘g’, and if it is a Latin or French derivative, it’s a soft ‘g’.
So can you think of a word which has two g’s and uses both rules? That’d be ‘language’! And ‘garage’ and ‘gigantic’ too. However, as I mentioned before, there are many irregularities. Words like ‘get’ and ‘give’ break the rule which is unfortunate for learners of English. What I’d suggest is making a note of exceptions to help you remember them, so here are a few exceptions to ‘get’ you started: