Basically you clean the print, then feed it into the scanner :)
I have a 4K film scanner similar to this.
https://www.youtube.com/watch?v=0bifK7uh9sI
It works the same way, it advances the film one frame, and captures 4 images, one Red, one Greed, one Blue and one Infrared (the infrared picks up just the scratches, dirt and dust). Those are combined to make a full colour image, with the damage matte in the alpha channel.
Each frame is saved out as a sequential uncompressed .DPX file.
As for cost, to get it done at a scanning company, it usually would cost anywhere from USD$8000 - $30,000 to get done.
If a film really needs preserving due to no good preservation of it existing, then I do it for no charge other than consumables such as film cleaning fluid, postage etc.
The film is then archived and ready for restoration, I colour grade the scan to match the print, any restoration from that point forwards is the concern of the print owner.
I do this because I believe in the importance of preserving our film heritage. I'm not involved in anything other than getting a preservation scan done and matched to the print.