M is the unit for concentration (C)
The units for concentration is mol/ L
To find moles you would have to multiply concentration x volume to cancel out the volume and find get moles (n)
For ex:
Moles (n) = C x V (concentration x volume)
N = 1.23 mol/L x 5L (vol. gets cancelled out)
N = 6.15 moles (you get left with moles)
OR to find concentration:
C = 6.15 moles / 5L
C = 1.23 mols/L OR 1.23 M