Cover the sofa with a couch-sized throw made to protect furniture from pets. Many pet stores carry these. The throw should be waterproof and made of a washable and durable fabric such as microfiber.
Spray pet repellent on the sofa. These products also are available at pet supply stores. These products repel pets from furniture using an offensive odor that only they can smell. Pet repellents are not harmful to humans or pets.
Create physical boundaries. Use baby gates to keep dogs and cats out of the room when you can't be in there with them.
Train your pets. Never allow them to climb up on the sofa. If you catch your pet on the sofa, discipline them immediately with a firm "no."
Make your pet comfortable. Often, accidents occur when pets are scared, nervous, lonely or trying to adjust to a new environment. Give your pet an alternative place to lay down instead of your couch. Buy a pet bed and make it comfortable for them with a toy, and if you like, a little blanket to cuddle up, too.