So, your friend hired an attorney. At any time, he could have fired the attorney and sought the services of another one. Although, if the matter was at the trial stage, the court may not allowed him to withdraw from the case.
Whenever an attorney gives his/her recommendation, or "professional" opinion, it is only that. It is up to the client to decide whether or not to take the plea. Maybe the plea offer was good and in your friend's best interests, or maybe it wasn't. It was up to your friend to decide. It is not uncommon for prosecutors to offer a "last minute" plea bargain. Unfortunately, sometimes, it doesn't give a person a whole lot of time to decide whether to enter the plea or not.
Your friend's attorney should have been advising him all along the way about possible plea offers and their consequences....and his absolute right to go to trial. Nothing should have been such a suprise that your friend felt should have felt terrified.
If your friend did plea guilty, the judge would have gone over all of your friend's constitutional rights, including his right to a trial. The judge would have asked him if the plea was "freely, knowingly and voluntarily" made. Also, the judge would have asked your friend if anything was promised, or he was threatened or coerced into taking the plea. And, your friend had to place facts on the record that would support the plea that he entered into. If at any time, the judge was uncomfortable with the answers, or your friend would have spoken up, the plea would not have been accepted, and your friend would have gone to trial on the original charge(s).
However, if all of the questions asked by the judge and answered by your friend that I outlined above were satisfactory, it may be harder to prove ineffective assistance of counsel. In order to be able to withdraw the plea, your friend may have to claim that he was "coerced" by the attorney to take the plea, and was afraid not to tell the judge because if he did, the judge might hold it against him. Again, there are no guarantees.
It is sometimes hard to withdraw a plea once all of the above factors have been placed on the record. However, if your friend is claiming "ineffective assistance" of counsel, and it is shown that the attorney did provide "ineffective service", your friend has a shot at being able to withdraw his plea and go to trial.
I understand that your friend pled "not contest." This meant that he didn't admit nor did he deny the facts set forth in the police report or other agreed upon facts, but that for purpose of sentencing the "no contest" was like a guilty plea. The prosecutor and defense attorney would have had to either allow the judge to review the police report or other documentation so that the judge could accept the accept the no contest plea. Also, there may have been "just enough facts" placed on the record to allow the judge to be satisfied that all of the elements of the crime occured and that your friend did the crime. Either way, the judge had to have enough information before him/her so as to legally accept the plea.
" No Contest" pleas are usually entered because the defendant had no recollection of the events due to drugs, alcohol or some type of medical issue OR because the defendant is concerned with civil liability as a result of his plea. For example, if a no contest plea was put on the record and your friend was sued civilly as a result of the incident, the plaintiff (victim) would have to prove that your friend was responsible for damages. The facts put on the record because of a guilty plea could not be used to support the plaintiff's claims.
If your friend pled "no contest" because his attorney said, "you don't have to say anything on the record about what happened", that would be wrong. Remember, however, the judge would go over the consequences of a "no contest" plea before allowing it to be accepted by the court. If your friend agreed and understood the consequences, again it would be hard to withdraw the plea.
Believe it or not, there have been cases where the attorney has been deemed to have provided "ineffective" assistance. It can be hard to prove, as the attorney will claim that everything he did, he did as a "strategy" to help your friend, and that is shown by the reduced plea or dismissal of some of the charges, or some type of sentence agreement. This is NOT an exhaustive list.
Given the long reaching effects of this matter, and the fact that your friend's liberty has been taken away, he really should contact an attorney who specializes in criminal appeals so that he can discuss the specific facts of his situation with him/her. If he is having a hard time doing so from in prison, you could also assist. You/he can contact the state bar association for a referral. The more advice, the better.
I wish you and your friend the best of luck.