One which is produced when you are leaving or quitting a job?
If so, I don't think it has to be a formal letter. It just needs to clearly state that you are leaving, giving the date when you will finish, and ending with something polite.
Here's an example I found.
Student or Learner