Disclaimer: I am not an attorney. Nothing in the following article should be considered legal advice.
Technically, yes, you can write your own contract. A contract does not have to be written by an attorney to be legally binding.
But the real question, like so many things in life, is should you? And no, you definitely shouldn’t. In many cases, it can actually be worse than having nothing. A straightforward contract might seem like no big deal to write yourself, but the law can be tricky and counterintuitive.
This is literally the only expense I suggest all freelancers take on. For a freelance contract template that you can use on all of your jobs, most business attorneys will quote you a price that won’t break the bank. If you’re light on cash, Rocketlaywer and LegalZoom offer decent options as well. The main drawbacks from the online services are that you do not have full control of the terms of the contract and it was written without your specific situation in mind.
However you get a contract written, you never want to end up in a dispute with a client and all you have to defend yourself is an informal agreement or a contract you wrote yourself.