The only way to learn what something sounds like as a non-native speaker is to look it up or listen to someone pronounce it. There are no rules – or at least no useful rules, because any rule will have many exceptions. Even different English dialects differ in how to pronounce words. There’s simply no making sense of it.
For example, in many British English dialects, the “a” in “can” and the one in “can’t” are pronounced completely differently, despite “can’t” being a contraction of “can not”. It’s literally the same word, just with a different word afterwords, and yet the two get different pronunciations. There’s no way to guess at that being the case, or come up with a logical reason why. You just have to accept it.
Meanwhile, me, a non-native English speaker:
The G is silent in English words starting with gn. Gnarly gnats is pronounced narly nats.
There’s not a lot of those words anyway
Gnu and gnome are exceptions only when used to describe the software. The gnu animal and the mythical gnome creature are pronounced with silent gs.
One does not learn English the language, one simply memorises it
The only way to learn what something sounds like as a non-native speaker is to look it up or listen to someone pronounce it. There are no rules – or at least no useful rules, because any rule will have many exceptions. Even different English dialects differ in how to pronounce words. There’s simply no making sense of it.
For example, in many British English dialects, the “a” in “can” and the one in “can’t” are pronounced completely differently, despite “can’t” being a contraction of “can not”. It’s literally the same word, just with a different word afterwords, and yet the two get different pronunciations. There’s no way to guess at that being the case, or come up with a logical reason why. You just have to accept it.
But a can of something?