Right, but that doesn't mean your precautions were worthless. Even if you are eventually going to catch it, delaying the infection reduces how much it can spread and means fewer people get it at the same time (reducing the impact). Some of these precautions will also reduce the severity of the illness, which is a huge win for you personally! Of course none of these precautions are perfect, but they're still helpful and limit the damage caused by the pandemic.
You're probably already well aware of this, of course! I've just seen a bunch of people saying things like "well I did X and I still got sick, so we shouldn't do X", which I don't think is the right conclusion for something that impacts the entire population. There's billions of dice rolls in this equation, and you got some bad luck (I'm sorry you got sick :( ), but I think you still gave yourself better odds and improved the odds for everybody else as well, which is great!