Easy way where feeding sockets is to use plug in tester. Martindale make the one most people use. Many other testers will do same job from PAT tester to Earth Loop Impedance tester as they test polarity before going into full test mode.
All these testers measure the voltage to earth and neutral should be within a few volts to earth and line should be near supply volts to earth.
That is assuming your working on normal domestic supply. On other supplies then it can get more complicated.