The assignor must agree to assign their rights and duties under the contract to the assignee. The assignee must agree to accept, or "assume," those contractual rights and duties. The other party to the initial contract must consent to the transfer of rights and obligations to the assignee.
Writing your own contracts is perfectly possible, and legal. But it's also an incredibly bad idea. There's two reasons for this: Property law is complicated. Because it's such a fundamental part of legislation, it's often lots and lots of different laws layered on top of each other.