Draw a line l and a point X on it. Through X, draw a line segment XY perpendicular to l.
Now draw a perpendicular to at Y. (use ruler and compasses)
Steps of Construction-
1. Draw a line l and take point X on it.
2. With X as centre and a convenient radius, draw an arc intersecting the line l at two points A and B.
3. With A and B as centres and a radius greater than XA, draw two arcs, which cut each other at C.
4. Join XC and produce it to Y. Then XY is perpendicular to l.
5. With Y as centre and a convenient radius, draw an arc intersecting XY at two points C and D.
6. With C and D as centres and radius greater than YD, draw two arcs which cut each other at F.
7. Join YF, then YF is perpendicular to XY at Y.