Quick answer
After г, к, х, ж, ш, щ, ч you never write ы — write и. Never я or ю — write а and у. That is why it is кни́ги, not “книгы”.
Rule 1: и instead of ы
| Would be | Actually | Why |
|---|---|---|
| кни́гы | кни́ги | after г |
| ру́сскый | ру́сский | after к |
| но́жы | ножи́ | after ж |
This is the rule you will meet first, because it hits the genitive singular and the nominative plural of half the feminine nouns.
Rule 2: а and у instead of я and ю
Rule 3: о or е after ж, ш, щ, ч, ц
When the ending is stressed, write о; when it is not, write е: врачо́м (stressed) but това́рищем (unstressed). Same word type, different letter — and the stress decides.
Why this matters
These rules are not decoration. They explain why the ending you carefully learned suddenly looks different — the ending is the same, the spelling just adapts to the consonant in front of it.
Typical mistakes
кни́гы
кни́ги
Never ы after г, к, х, ж, ш, щ, ч.
врачем
врачо́м
The ending is stressed, so о.
Check yourself
What is the plural of кни́га?