How to backup and retrive chat history and file attachments

hi everyone ,

Is someone knows where are chat attachments are stored and how retrieve them.