Polish has cases and one of these is the genitive. It is used (among other things) to indicate possession, after certain verbs, after certain prepositions, numbers greater than four and negation.
As usual the ending depends on whether the noun is masucline, feminine, neuter (singular or plural).
If the noun ends with an a in the nominative, change the a to a y. So kawa 'coffee' becomes kawy in the genitive and praca 'work' becomes pracy.
There is a general Polish spelling rule so that when y follows k it changes to i. So Polka 'Polish woman' is Polki in the genitive.
If the noun ends with an o or e in the nominative, this becomes a in the genitive. So wino 'wine' becomes wina or zdjęcie 'photo' becomes zdjęcia.
These are more tricky.
A Polish masuline noun in the genitive will normally add an a or u if it ends in a consonant.
So dom 'house' becomes domu and sok 'house' becomes soku but telewizor 'house' becomes telewizora.
You have to learn these, as there is no way of knowing whether to an a or u should be added.
Remember that in Polish there is often a difference between masculine animate (living) nouns and masculine inanimate nouns (everything else). The genitive is no exception and Polish animate nouns normally add an a in the genitive. So syn 'son' becomes syna and brat 'brother' becomes brata.
Look for the ending ów.
And to form the genitive, you can (quite) often add ów to the noun. E.g. student becomes studentów in the genitive.
But look, uczeń 'student' becomes uczniów, so beware. Still, the ending is a good one to look out for when you are starting to learn the language and are feeling overwhelmed by the various different possibilities.
Often, these drop the final vowel, so a neuter noun would drop e, o or ie and a feminine noun would drop a or i.
These rules are a guideline only and cover the most frequently encountered endings, and are not exhaustive. They simplify the possible endings and are a good place to start.