Let’s take an example
Draw a line segment of length 5 cm
Let’s follow these steps

Draw a line
l
mark point A on it
Advertisement

Since length is 5 cm,
we measure 5 cm using ruler and compass
Advertisement

Now keeping compass opened the same length.
We keep pointed end at point A,
and draw an arc on line l