Syntax is the set of rules that govern how words are combined to form phrases [groups of words that work together to function as a single unit;], clauses [groups of words that contain a subject and a verb], and sentences [groups of words that form a complete thought.] in a language. It deals with the arrangement and order of words to convey meaning.
Example: In English, a basic sentence follows a subject-verb-object order. For instance, “John reads a book” is a valid sentence. However, “book reads a John” is not correct because it violates the syntax rules of the English language.
Very Simple Definition:
Syntax is the grammar rules that tell us how to put words together to make sentences.
Example: “I eat breakfast” and “Breakfast I eat” have different syntax because the first one is correct, and the second one is not.