How should you write people who are mentally ill????
It depends on the illness, but no matter what: research.
Representation is important, but only true representation. Negative representation hurts a thousand more times than it helps.
Find out how they act, how their illness affects their lifestyle, how severe their illness is, how other people react to it- if at all, etc.
Here's a list of illnesses and some information on them to get you started.
If you need any more help or have any further, more specific questions on the topic, let me know!