Staight edges, as pointed out, are to lay out straight lines and to check if things are straight and flat.
Wooden materials are bad to use as staight edges as they usually have bows in them. Squares and metal rulers are good straight edges. Plastic rules are also good straight edges. A drywall square has a 4 foot straight edge with measured increments. For very long straight lines, a chalked string line (called a snap line) can be used.
In expensive large straight edges can be purchased as "flat ground steel" from industrial suppliers like MSC Industrial or McMaster-Carr.
Be very careful with your straight edges as they can get easily get nicks that will effect their ability to measure flatness.
Testing a Straight Edge
If you compare any three straight edges thay can only be straight if they all match. Any two straight edges can match if they have the same curve. But, for three to match they must all be straight.