I feel your pain, it absolutely sucks to get hard-countered in lane and to be forced to play passively.
Minion wave management is a useful technique to help you work around this and to still be able to do something about your opponent even when they force you to play passive. Here is SoloRenektonOnly's youtube playlist on creep wave management. In some of his gameplay videos you will see him play a losing lane and still come out ahead of the opponent because he beat them with minion wave management instead of fighting or trading directly with him.
I'm not the most qualified person to talk about the following, but I feel it is still relevant and may help you in this situation:
In some cases it is best to not worry about your lane opponent and just build what you need to be effective later in the game. IMO building defensive on a carry is only worthwhile if it makes it safe for you to farm or if it contributes towards something you were planning to build for late-game anyway.
Example 1: For example a Seeker's Armguard rush as Swain works great against AD characters like Garen because it gives you armor to resist his damage while also being a component for the Zhonyas Hourglass that he can make good use of in teamfights later.
Example 2: You built a Liandry's Torment that game, which is strong in cases where the enemy team has a lot of tanks, but in your particular game it only really helped against the Garen (and maybe Mordekaiser), who was going to be much more difficult to kill anyway. Better to take the path of least resistance and not fight as much of an up-hill battle in order to be effective.