Why is the K silent in "knowledge" and "know"? I have heard many non-natives pronounce the K but not natives. In dictionaries there is no K in the pronunciation but there is a K in spelling.
Every language has a fixed set of rules called 'Phonotactic rules' that govern the licit and illicit sequences of sounds in syllables. A sequence of sounds that is allowed in one language may not be allowed in another language, for instance, the cluster /pn-/ is phonotactically well-formed in Greek, but ill-formed in English, that's why the /p/ in pneumonia is pronounced in Greek, but dropped in English.
Over time, a language may undergo phonotactic change. The cluster /kn-/ wasn't always silent; the /k/ was pronounced in Old & Middle English. In Modern English, the tautosyllabic1 cluster /kn/ is impermissible (or rather, banned). English cannot have a word start with Plosive + Nasal sequences, the clusters /kn-/, /gn-/, /pn-/, tn-/, /dn-/, /bn-/2 etc., are therefore not allowed.
Whenever a word starts with Plosive + Nasal, the plosive is usually dropped from pronunciation.
The k in know and knowledge was pronounced up until Modern English. The cluster /kn-/ was a part of the phonemic inventory of Old & Middle English, but it ceased to be a part of Modern English probably because changing from oral to nasal in the same syllable became awkward-to-pronounce for Modern English speakers, that's why there's no /k/ in ⟨kn-⟩3 sequences. However, the k is retained in spelling.
1. 'Tautosyllabic' means within the same syllable.
2. /slashes/ represent 'sounds' (more precisely, the mental representation of sounds), not 'spelling'.
3. ⟨Angled brackets⟩ represent 'orthography' (spelling)
Regarding "know," you will notice certain patterns in English pronunciation that allow you to make a good guess at a word's pronunciation even if you've never encountered the word before. For example, I think the combination kn- at the beginning of a word is always pronounced as "n-" (silent K) in English words. Examples: know, knew, knoll, knack, knave, knight, knell. (Many of these are "old" words, not used in everyday speech anymore.) This rule is true even when prefixes are added: unknown, foreknowledge, acknowledge -- In the word "acknowledge," there is a "k" sound from the "ac-" prefix (rhymes with "back") but the "k" is still silent. The only exceptions would be for some proper names: For example, in the family name "Knudsen" and the name "Knut" (a Danish king who lived around 1000 AD, usually spelled "Cnut" in English), the K and N are both pronounced.
Other patterns you will notice are that "[consonant] + igh" is always pronounced as in "sigh" and "[consonant] + ight" is always pronounced as in "night." When a consonant is followed by "-igh" or "-ight," the vowel is a "long i" and the G and H are silent.
Examples: high, nigh, thigh, right, tight, fight, sight, light, might, plight.
The reason I specified that there must be a consonant before "-igh(t)" for this rule to be guaranteed to be true is that many words with a vowel + "-igh(t)" do not follow this rule.
Examples: weigh, weight, sleigh, neighbor, straight, freight, inveigh. (These all have the same vowel as "ate.")
However, the words height and sleight do rhyme with night! You just have to learn these ones on a case by case basis. The combination "-ough" is notoriously variable in its pronunciation in English, so you have to memorize all of those individually.
Side note: There is a phenomenon in certain varieties of English, including my own (Chicago/Great Lakes region), that is called Canadian Raising. One feature of this phenomenon is that the vowel in "high" is not the same as the vowel in "height." In "height," the "long i" of "high" gets "raised" in phonetic terms because it precedes "t," a voiceless consonant. This distinction is rather advanced and most native English speakers are probably not even consciously aware of this type of pattern. However, I wanted to point it out for those who are interested and want to learn more about it.
English is... an extremely inconsistent language! It's the result of many different languages coming together and developing over time, and we never had an official standardisation to "tidy up" the issues. US English has made some attempts to modernise spelling and make it more consistent, but it's still light-years away from something like Spanish, for example.
The short version is: sorry, you just have to learn how everything is pronounced! There are some basic rules you can learn, which work most of the time - after a while you'll notice patterns, and you'll see how words connect to other words you know, and it'll become easier.
I think most native speakers can make a good guess at how most unfamiliar words are pronounced, and that's because we just develop an unconscious understanding of the rules from being immersed in the language. But we can still get tripped up - I just learned that hough is another spelling of hock and is pronounced the same way! That was a new -ough for me, I thought I'd heard them all.
But yeah, trust the dictionary, not the spelling.