How can I ask editor to send me a formal acceptance letter of my paper to use it in my university?
You send an email to the editor asking for a formal acceptance letter of your paper. Be sure to identify which paper it is about.
If desired, add a second paragraph to your email, which explains why you need such a letter. Do not hide anything necessary in the paragraph.
Be polite and to the point.