If a rightsholder in the U.S. wants to go to court to defend against infringement, that copyright must be registered with the U.S. Copyright Office. Publishers will do that when they publish a work, or the creator of the work can register it themself.
A rightsholder can register their copyright right before suing their copyright infringer. For works whose commercial exploitation needs to be protected, it's best to register copyright as soon as possible, because in the U.S., if a resident or citizen puts their work "out in the wild" and doesn't register for five years, they can't collect statutory damages. They can still sue though!
Registering a copyright costs $140 and can be done print or online, depending on the kind of work. It creates a public record, and copy of the work is deposited with the Library of Congress.