Draw a line with a ruler, and note how long it is in inches or centimeters.
Put the point of the compass on one end of the line, and set the radius of the compass so that it is a little bit longer than half the length of the line. Draw a half circle that intersects the line.
Do the same thing at the other end of the line so that you have two half-circles that intersect each other at two points.
Use your ruler to draw a line between the two points where the circles intersect. This line will be perfectly perpendicular to the other line.