How to increase tension of rear derailleur cable
You started with too much slack for the barrel adjuster(s) to take up. Note you have one on your derailer and one on your shifter, and they both do exactly the same thing, so maybe by using both you'll have enough adjustability, or maybe not. It doesn't matter because you don't really want to be maxing them out anyway. You need to re-anchor the cable in a more reasonable spot, and ideally check a few other things along the way.

Shift the shifter into the highest position. (Slackest cable tension, biggest number, the one you get to by pressing the pointer finger lever a bunch of times.) Loosen the RD cable anchor. Pedal the bike so that the chain is on the smallest cog. Take the opportunity with all the cable tension off to visually check that your high limit screw is set correctly. Looking behind the bike, the center plane of the RD pulleys should be that of the right/outer plane of the smallest cog, or in other words very close to but just a little to the right of the center plane as the smallest cog teeth. (counter-intuitive but true, as per Shimano.) Screw both barrel adjusters all the way in, then screw one out one full turn so you have some adjustability in both directions if needed. Using any pliers, grab the end of the cable and pull it taut while tightening the anchor bolt back down. You don't need to pull it hard. You want it to be clamped at the spot that makes it just taut. Unless there are other problems with cable friction, busted housings, hanger alignment, damage to the derailer, etc, the bike should now be approximately shifting, although the shifting will need final adjustment to perform correctly.

But before you do that, since you had problems with excessive slack that started all this, you should do one more step that will reduce and/or eliminate further such issues with "stretch." (Whether or not the cable is physically stretching at all is a contested issue, but it doesn't matter, and either way it's not the main thing causing the slack.) Keeping the shifter in the same highest/slackest position, hang the bike by the seat off a stand or tree or something, and pedal the cranks with one hand while pulling gently on an exposed part of the cable with the other. Once you're in the lowest/largest cog, stop pedaling, stop the rear wheel from spinning and pull hard on the cable. Let go, pedal again to get the chain back down to the high gear, and see if you've created slack in the cable. If so, that's a good thing, because it would have happened eventually anyway. If there is slack then take it out by repeating the above re-anchoring procedure.

At this point, dial in the shifting with the barrel adjusters so that it shifts smoothly with minimal hesitation in both directions, and you should be set.