General Rule:
* Use a comma after the city name and before the state abbreviation.
Examples:
* She lives in San Francisco, California.
* We're planning a trip to New York City, New York.
* The company's headquarters are located in Chicago, Illinois.
Exceptions:
* When the city and state are at the end of the sentence, no comma is needed: We're moving to Austin Texas.
* When the city and state are part of a longer address, use commas to separate each element: The package was sent to 123 Main Street, Anytown, CA 91234.
Additional Notes:
* State abbreviations are always two letters, and they are never followed by a period.
* The city name should always be spelled out in full, except in cases where it's a widely known abbreviation (like NYC).
* If you're using a comma after the city name, the state abbreviation should be followed by a period.
Example:
* Incorrect: We went to Los Angeles CA last week.
* Correct: We went to Los Angeles, CA last week.