When do we use brackets and semicolon

While coding we use brackets in if and while why?
when and what is the use of brackets and semicolons?

If an if , while , or for statement is used in a macro, the macro definition should not conclude with a semicolon. (See PRE11-C. Do not conclude macro definitions with a semicolon.)

Braces improve the uniformity and readability of code. More important, when inserting an additional statement into a body containing only a single statement, it is easy to forget to add braces because the indentation gives strong (but misleading) guidance to the structure.

Braces also help ensure that conditions with multiple statements are properly expanded.