I am just confused how can a voltmeter which has a very large resistance and hence small current or in ideal condition zero current still measure potential different because as far as I know voltmeter is modified galvanometer and a galvanometer shows deflection only if current passes through it.
Voltmeters come in many forms and as their implies they measure a difference in potential between two points.
One important characteristic of a voltmeter is that it does not alter the potential difference it is trying to measure and this usually means that its resistance is much higher than the resistance in the circuit where the potential difference originates.
For example if a current of $1$ mA is passing through a resistor of $1$ k$ \Omega$ then the potential difference across the resistor is $1$ volts.
Putting a voltmeter of resistance $1$ k$ \Omega$ across the resistor would mean that the current through the resistor would now be $0.5$ mA with the other half of the current passing through the voltmeter.
So the voltmeter reading would now be $0.5$ V.
However if the voltmeter had a resistance of $10$ M$ \Omega$ the volmeter would read $0.9999$ V because most of the current of $1$ mA would be flowing through the resistor and very little through the voltmeter.
Most portable multimeters have an impedance of 10 MΩ on their voltage ranges (excluding "Low-Z" ranges). That is enough to allow a very small but measurable current to flow.
If the device under test also has a high impedance, this must be corrected for by the user - or a different measuring tool selected. See Burden Voltage for an example of the problems caused by a non-ideal real-world meter.