To do this safely, you use the water from your tank and the pump from your tank.
It is best if you do not feed your fish from the day before you plan to do this. Do not feed your fish until two days after you have replaced everything you want in your tank.
You might want to lower the temperature by 1-2 °C in your holding tank - this will buy you some extra time to finish the job in the main tank.
You can keep the fish in the holding tank for maximum 48 hours and remember: no food during this time, let your pump run continuously for the duration of the time your fish are in the holding tank. The reason I say 48 hours max is the fish will be stressed when they have to live close to each other in a small space.
Do not clean the pump/filter at all until at least a week after you have finished everything in your main tank; you will need all the good bacteria you have to avoid ammonia and nitrite, and feed very little the two first weeks after this job.
If you are replacing the pump/filter in your main tank you need to use both pump/filters for a week to be sure the biological cycle keeps going in your tank, if it is impossible to run two filters you need to take out the filter media from the old filter and put this into your tank to seed it with bacteria.