“I read him the riot act,” means “a stern reprimand or warning of consequences.”

Riots of 2020
In 2020, the gatherings in Seattle, Portland, and Minneapolis, turned to into violence and looting. At some point the police make the announcement: “This has been declared a riot. Disperse immediately or you will be arrested.”
The crowd has just been “Read the Riot Act.”
The 1714 Riot Act
In 1714, the British Parliament passed the “Riot Act.” This was an “Act for Preventing Tumults and Riotous Assemblies, and for the More Speedy and Effectual Punishing the Rioters.”
The Riot Act of 1714 authorized local authorities to declare any group of 12 or more people to be an unlawful assembly and order them to disperse or face arrest and prosecution. A person violating the act could be subject to fine, imprisonment, or even death.

Reading the Riot Act
Before making arrests, the authorities read the following language: (like something from Monty Python):
“Our sovereign Lord the King chargeth and commandeth all persons, being assembled, immediately to disperse themselves, and peaceably to depart to their habitations, or to their lawful business, upon the pains contained in the act made in the first year of King George, for preventing tumults and riotous assemblies. God save the King.”
California Law
Under California law, it is a crime to “participate” in a riot. (Penal Code Section 405)

“Any use of force or violence, disturbing the public peace, or any threat to use force or violence, if accompanied by immediate power of execution, by two or more persons acting together, and without authority of law, is a riot.” (California Penal Code Section 404(a).)
It is also a crime to “incite” a riot.
“Every person who with the intent to cause a riot does an act or engages in conduct that urges a riot, or urges others to commit acts of force or violence, or the burning or destroying of property . . . is guilty of incitement to riot.” (Penal Code Section 404.6.)
Participating in or inciting a riot are misdemeanors carrying up to 1 year in jail or a $1000 fine. (Of course, torching a police car or firebombing an inhabited building are separate serious felonies carrying prison sentences from 18 months to life-without-parole.)
300-Year-Old-Tradition
Today, following the 300-year-old tradition, police still “read the riot act.”
(See: “Riot Act,” Wikipedia)