Consider the loop to the left to be loop A and that to the right to be loop B
According to Kirchhoff's voltage law find out the current in loop A and loop B
current in loop A comes out to be 0.4A in the anticlockwise direction
current in loop B comes out to be 0.5A in the clockwise direction
while applying KVL do not consider the 4V battery connecting the two loops since no current flows through it.
Now when it comes to finding the potential difference between the two points X and Y assume you connect a voltmeter between the points X and Y
then the circuit becomes as shown in the diagram below(you can also observe that i have marked different points on the loop with alphabets so that it is easier to explain in the later steps)
now when it comes to finding the potential difference you can either consider the potential drop recorded across the path XABPQY or the path XABPRY(you can later verify that both the paths give the same answer)
Now i am going to choose the path XABPRY since this is more simpler
in this path the potential drop is recorded across the 2V battery, 4V battery in the middle and the 3ohm resistor in the second loop
so total p.d recorded is going to be +2 volts(by 2V battery), +4V(by the 4V battery) and +3*0.5 V(1.5V) (potential drop across the 3 ohm resistor - taken with positive sign because the assumed direction is opposite to the direction of current)
so the total potential drop between X and Y comes out to be 7.5 V
you will get the same answer if you go along the path XABPQY
Hope it helps.