Unless you have very depressed friends, it's not something that can really be done I'm afraid. A note or even several addressed to specific people can help bring some closure. I've heard about leaving a list of your social accounts, emails etc with a list of passwords so they can go through any thoughts you might have expressed. It's one way to go about it, but I could also see it messing with certain types of people. Endlessly scrawling through your posts and comments to try and find something to make sense of it all.
Personally, I think a well thought out note or set of notes is the least messy way to go. The vast majority of people are going to try and make an effort to keep you alive.
Edit: That said, I have no idea what your situation is or how old you are. People will be more receptive to the idea the older and more physically unwell you are. If you're just mentally unwell, most people want you to hang around...