Because a guilty plea must be made intelligently, knowingly, and voluntarily, the court must advise the defendant of the following things: The court must ask the defendant if he understands each of these points, and must receive a voluntary affirmative response.
Many courts use a script of the questions which the judge will ask the defendant and the defense attorney in a specific order.
Pursuant to the Sixth Amendment to the U.S. Constitution, a criminal defendant has the right to be represented by an attorney during a plea colloquy; failure of the state to provide an attorney to an indigent defendant during such proceedings is grounds for an appeal.
It is possible - but very difficult - for a defendant who is so represented to have a plea thrown out due to ineffective assistance of counsel.
The defendant must make a positive showing that but for the erroneous advice of counsel, he would not have chosen to plead guilty.