Step by step:
1. Open the compass to a radius less than half the segment MN.
2. Usin point P as center draw two arcs that intersecs line MN on both sides of the point P (As you use the compass those arcs are in the same distance from point P)
3. Lavel the point of intersection of arcs with line MN (Use any other letter as A and B)
4. Use the points A and B as centers and using the compass draw two arcs (one with each point A and B) above the line that intersects each other.
5. Mark the point of intersection of arcs and link it with point P (as the line needs to go throught P corss point P and continue with the line) . That line is the perpendicular line to MN trought point P)