Draw a line AB ⊥ to number line, such that the length of AB is 1 unit.
Join OB. Now, applying pythagoras theoram,
OB2=OA2+AB2=1+1=2
⇒OB=√2
Take compass & taking O as centre & OB as radius, cut the number line. The distance OS will represent √2 units.