For active duty personnel, contact your servicing personnel office and ask for the "Proof of Service" letter. Some branches of the military have electronic versions that you can download, find out where you can get yours.
For retired members, you need your DD-214 you received when you retired.