I have had relationships that ended badly and where we ended contact. I have had relationships that ended well and we remained friends. In one case we continued to live in the same house for another year, until she fell out of love with my city for reasons having nothing to do with me and moved away. There is no one single answer; it depends on who you are, who the other person is, and how that particular relationship went.
For those of you who DO want to stay friends with an ex, it’s important that you make sure that the desire is mutual. Don’t force yourself on somebody who would prefer to have you out of their life.
If they do welcome some degree of friendship, stay with the boundaries of what they want and don’t push for more. Pressuring people for more from a relationship is never good, but it’s doubleplusungood in the case of an ex.