One thing is true for all military personnel no matter what their rank. They will eventually all leave the service. There is a formal process for turning in one's resignation. Below are some links to help guide you through the process.
Please note regardless of the type of scholarship there is an 8 year statutory service obligation. If you had a 4 year HPSP scholarship and served on active duty for 4 years you would still owe 4 years in a reserve component in accordance with 10 USC 651. This can be served on the inactive reserves.
In the Navy if you are USN you turn in an "unqualified resignation". If you are USN'''R''' you turn in a Release from Active Duty (RAD). Please refer to the Navy Personnel Command (NPC) website for more information.