Let us take, ginger, we actually pronounce it as /ˈdʒɪndʒə/ (jinjer). But take, giggling, we pronounce it as /ˈɡɪɡ(ə)lɪŋ/. There are numerous examples of this, and this confuses me a lot. So, how do I know which pronunciation in these kinds of words is actually correct?
There are no strict rules for when the letter <G> is pronounced /dʒ/ as in ginger and when it is pronounced /g/ as in giggle. In general, it is more likely to be pronounced to /dʒ/ if it is followed by <I>, <E> or <Y>, but there are many exceptions.
If you're unsure about a word, you have to look it up in a dictionary and memorize it.