can I write off these expenses?
Yes.
Hiring an editor for contract services would qualify as an ordinary and necessary expense for an author.