This is done by conducting a search in a database that lists all registered and pending marks. A good trademark search covers both state and federal registered marks. A trademark attorney can help you evaluate whether your particular mark is available or whether it may infringe on someone else's use of their own mark. After determining that your mark is available for use, a trademark attorney can file a trademark registration on your behalf. State trademark registration may only require a cursory review before a registration may be obtained.
Federal registration requires a more thorough review.
However, federal registration generally allows an owner the right to use the registered mark nationwide. Therefore, it is prudent to apply for a federal registration. Applications can be made before a mark is actually used. The applicant states the intended use of the mark. Applications can also be made after a mark is used.