When referring to a programming language, syntax is a set of rules for grammar and spelling. In other words, it means using character structures that a computer can interpret. For example, if a user tries to execute a command without proper syntax, it generates syntax error, usually causing the program to fail.
In a text editor that supports syntax highlighting, the programming language's syntax elements (keywords, variable names, operators, etc.) are colored, making it easier to read the code.