One of my previous cats used to get so stressed in a carrier that he would pee in it. Then, he'd have to get a bath afterwards, making the whole situation even worse for him and us. My partner did some research and bought a couple of soft sided carriers that didn't look at all like hard ones the cat was used to. We unzipped all the sides, decked them out in blankets that smelled like our cat and then liberally sprinkled them with treats. Within a couple of days, our cat had come to think of these as cat houses instead of carriers. When he needed to be zipped up in it, he was docile and willing. He thought of it as a safe space, and it helped lower his stress levels when he was taken outside the house in it. Those carriers are now constantly in use as cat houses in our home. It was truly one of the best cat tricks I ever learned!
Our cat would get so stressed when I tried to put her in a carrier that she would attack me. I still have a scar on my left arm where she bit me hard enough to sink her canine teeth all the way in. I had to cancel the vet appointment that day because I was bleeding profusely and the cat was hiding somewhere in the house.
After that I bought a soft carrier, too. Mine is called "Cat in the Bag" or something like that. It's literally a canvas sack with a zipper, a carry strap, and a head hole with velcro adjustment. I just pop it over her head, adjust it to fit, then zip her up. She's contained but her head is out and she can look around freely. She still doesn't like it, but she doesn't freak out and go into fight mode.