Replace mechanical pot with digital
To figure out you should post the scheme. But in general you can replace mechanical potentiometer with digital, if you are sure the voltage and current are within maximum ratings of the latter. Also be sure to protect the digital potentiometer with shottky diodes to prevent voltage spikes, they may be lethal.