You can do this using Time Machine, or with a system cloning tool. The first step in any factory reset of the system is to completely back it up. Of course you might consider removing your user account from the system, and setting up a new administrative account for the new users, but the easiest and most thorough way is to fully format your system and reinstall OS X. If you are selling or donating your old Mac, then you might want to factory reset the system not only to provide the new users with a fresh start, but also to ensure your data is secured from the new owners.