How do you fix a valve on a bathtub tap that switches from bath to shower?

It will depend on the type of faucet if it is a three handle or has a popup in the spout popup in the spout will be the easiest to repair do so just by replacing with a new spout if it is a three handle you will have toremove the center handle and then remove the stem there will be a washer of some type replace the washer and put back together and try.