Mental Health-Related Legal Defense Aid & Assist

What happens when an individual cannot aid and assist in their own defense against criminal charges as a result of their mental health issues?