This is a pretty complicated and ambitious project. My descriptions below are merely an outline because every aspect of this job is involved and complicated to some degree.
If the carpet you are talking about is in the bathroom then you should think about replacing it with tile or vinyl flooring.
If there is drywall (greenboard, blue board or grey board, i.e. paper outside and white stuff inside) behind the tile I would just remove it, at least as high as the tile goes. This will be much easier than trying to remove the tiles from it, patch it and redo. Also, this will let you inspect or replace any soggy insulation etc.. You can replace it with cement board. Make sure the cement backer board goes OVER the top flange of the tub so that any water that gets in there sheds INTO the tub. Seal the joints with mesh tape and thinset mortar. Then re-tile the walls, using thinset mortar to attach. Then grout and seal the grout with silicone grout sealer. Clean and re-seal every year.
OR, you can buy a fiberglass tub/shower surround and apply it over the whole mess. These are the fiberglass walls, above the tub or shower that you can buy with a tub and I think you can buy them separately. I would seriously consider this, as it could save you 10's of hours of work and some money and mess.
If you have carpet damage you might have rot in your plywood subfloor. If it is minor you can remove the bad spot(s) and repair. I'm out of time now so others can talk more about the tub and other issues.