This is a tiny little diagram that saved my ass when i had it downloaded to my phone and my bike chain started to act wonky and fall off the end of cassette while i was switching into the top or bottom gear. There are many websites that tell you how to tune your rear derailleur, but in my experience they are hard to understand when you are stuck on the side of the road with a busted bike. This picture shows exactly what happens when you adjust the screws, no more, no less.
You want to adjust it so that the chain comfortably slots into the biggest cog (uphill gear) and smallest cog (downhill gear) when you adjust the gear lever(s) at the front. Once you have adjusted it so the derailleur can push the chain all the way into the top and the bottom without it falling off the end, then you can twist the tension adjuster on the cable one way or the other to make the lever(s) switch cleanly between the cogs in the middle (try one direction first, and if it gets clunkier, try the other direction).
You can also use these trim screws to only use a subset of the cogs, e.g. if your cassette has 7 cogs, but your gear lever only has 6 settings, you can choose which 6 adjacent cogs to use depending on if you want to go uphill more or downhill more.
You want to adjust it so that the chain comfortably slots into the biggest cog (uphill gear) and smallest cog (downhill gear) when you adjust the gear lever(s) at the front. Once you have adjusted it so the derailleur can push the chain all the way into the top and the bottom without it falling off the end, then you can twist the tension adjuster on the cable one way or the other to make the lever(s) switch cleanly between the cogs in the middle (try one direction first, and if it gets clunkier, try the other direction).
You can also use these trim screws to only use a subset of the cogs, e.g. if your cassette has 7 cogs, but your gear lever only has 6 settings, you can choose which 6 adjacent cogs to use depending on if you want to go uphill more or downhill more.