Who ordains it? Does the town mayor have authority over who gets to enforce the law? Is it the state legislature? The governor?
Not sure if it’s still done but in some states the sheriff or police chief used to be elected by the people.
So I guess you would have enough to have a town charter and then the town would set up the necessary services.
Some would be done by a governor some by the major.
In the USA the state does. The state constitution usually includes the process for incorporating new cities, etc. Since this is a state power, the exact answer to your question will be “it depends on the state”.
They usually establish a contract to get coverage from another PD until they can create their own. There are cities in LA that have no PD and instead have contracts for the LA sheriff’s to cover the area.
Town draws up a charter describing what kind of police force it will have, state legislature approves the charter, police force is established. Bing, bang, boom.
It would be up to the state legislature to write the laws regarding how to define and structure the police. These laws may have sections which allow for a county, city, or other municipalities to create police forces.