Slavery has been abolished, so you cannot prevent your advisor from quitting his or her job and thereby stop being your advisor. The vast majority of faculty takes the job of advising a Ph.D. student or an M.S. student very seriously and will try their best to not abandon them. If they were to do so without grave reason (e.g. being suddenly diagnosed with late stage cancer, having to care for a parent in a different country whose status has suddenly worsened) there would be repercussions on their career. Even if an advisor is suddenly offered a dream job somewhere else, they are expected to make arrangements for their students.
Involving someone else as a co-advisor is not a usual means of abandoning a student, but is usually motivated in trying to provide "better care" for the student.
At this point, you have not spoken to your advisor and you do not know what is happening. If your advisor is leaving the university, then appointing a co-advisor means that the advisor is NOT abandoning you, because he could just tell you that you have a new advisor, or tell you that both of you will look for a new advisor. Your advisor can also simply be thinking that the thesis / project / or what ever it is that he is advising you on needs some additional expertise. It could also be that your advisor is interested in getting more involved and bringing in someone else is forming an ad hoc research group. There are just too many possibilities.
To quote John Custer from the comments, you DO need to take a big breath and wait until you know whether something is happening and whether this something is not to your liking. Again, academia frowns on professors abandoning their students without grave cause.