A guideline is a rule-of-thumb or suggestion that shows or tells you how to behave. If you want to stay healthy, you might want to follow the government's dietary guidelines. Sample guideline: go easy on the salt.
In the 18th century, guideline referred to an actual line that you drew on fabric before cutting. So for example, if you wanted to cut a piece of linen to make a dress, you'd draw a guideline on it first to make sure the incision would be straight. The line guided your cut; over time, the word became a metaphor for a guide to any sort of action.