In the US, trademark rights are created by using the mark (name, logo, tag line, etc.) in connection with goods or services.
While you can have enforceable trademark rights without registering the mark, it is usually beneficial to obtain a federal trademark registration.
Creating a trademark through use is called a “common law trademark.” When you start using a brand name, you are establishing a right to use that name exclusively. This is limited to just where you are offering the service (city, state, or region) and the goods and services being offered under the trademark.
You can also register your trademark with the USPTO. This doesn’t create the right (using it does) - But registering makes it easier to enforce your right to use the trademark exclusively because it counts as evidence that you own it.
Some other reasons why it’s good to register:
You don’t get any of these advantages with a common law trademark.
Recap: Trademarks are created by selling goods or services under them (“common law” trademark); registering the trademark serves as evidence that you own the mark, which makes it easier to protect.