The simple answer is you don’t need to. Although there are plenty of companies on the internet offering to “register” your copyright – for a fee – you don’t actually need to do anything to own the copyright to your own writing. Copyright law is very clear: as a writer, you automatically own whatever you have written, and you can sue anyone who copies it.
Some people get anxious about whether they need to “register” their copyright in order to prove it. At one time the advice was to send yourself a copy of your manuscript through the mail and never open it – then, if you needed to prove in court that you wrote those words before anyone else, you’d have sealed, date-stamped proof. Nowadays your computer would probably show the date you produced your work. It’s very rare, though, for that to be the issue in a copyright case; it would only be useful if someone copies the whole of your work and then claims that you copied them. Frankly, most cases of copyright breach are not like this, because it’s fairly easy to prove who wrote it first. Most court cases are about proving that someone has copied an author’s style of writing, or plot, or characters, as opposed to simply writing something coincidentally similar.
And that’s where copyright problems usually lie: you might think someone has stolen your idea, but they might successfully argue that they came up with the idea themselves and it just happens to be a bit like yours. Creative ideas flow around the world, influencing each other, so it’s hard to say what’s “copying” and what’s not. People can independently have the same idea for a story or a setting or a descriptive phrase.
So how can you protect your writing from being “stolen”? Well, if someone has clearly copied your work, then contact them and demand they withdraw – don’t worry about “proving” your copyright; if it gets as far as court, you’ll have plenty of evidence, from your laptop to witness statements from your friends to your own evidence under oath. In the meantime, don’t get too worked up about it. If you worry too much about people stealing your writing you’ll never publish it!
And remember, imitation is the sincerest form of flattery.