There are various things you can do to get rid of CYA and CH, but none of them are nearly as simple or inexpensive as replacing water. In situations where you are under severe water restrictions, it might be worth exploring some of the other options, but even then they are usually too expensive or too difficult to be practical.
CH can be removed with a water softener. However, whole house residential water softeners are not designed to handle the volume of water in a swimming pool. You can still get this to work by pumping water through the water softener quite slowly and recharging the water softener very frequently, but the cost and level of effort is typically rather extreme and water is lost each time the water softener is recharged.
CYA can be removed with melamine, using the same reaction used in the CYA turbidity test. There was a commercial product that worked this way for a couple of years, but it was discontinued because of the high costs and poor results. What usually happens is that the CYA will combine with the melamine and form an extremely fine powder that remains in suspension, causing the pool to become cloudy white and opaque. It is possible to clear up the cloudiness with additional chemicals and lots of work, but the amount of time, level of effort and expense quickly become prohibitive.
There are a couple of commercial services that filter your water through reverse osmosis filters, which remove all of the dissolved solids in the water, including both CYA and CH and just about everything else as well. The size and cost of the filters required for swimming pool amounts of water are both fairly extreme, so this is normally only practical as a service. This approach also uses up a fair bit of water, since the removed solids must be flushed out of the filters with pool water, which is lost.
There is a
commercial service that removes CH from the water by precipitating it out rapidly and vacuuming up the resulting paste. This process is complex, patented, and requires heavy equipment. Currently this service is only available in the greater Phoenix region.