Using the potentiometer, change the resistance until the contrast is what you want. Then turn the power off and connect a multimeter to calculate the resistance for your selected contrast. Place on probe on the pin connected to Vcc, the other to the middle pin. Or you can place one probe on the middle pin and the other on the pin connected to ground and subtract from 10K ohms. If you want to replace simply replace the potentiometer with the same value of resistance (or closest value to it). One pin of the resistor connects to Vcc the other to the input of your LCD.
Good luck