Ya gotta want it.
Get good grades in school. Contact your Congressman about a recommendation to the US Naval Academy. They will provide guidance in this process. Assuming you become a candidate, follow through, there will be interviews, exams and paperwork.
Talk to a Naval Recruiter and see what you're best suited for and they'll tell you how to do it but everyone goes thru Basic Training no matter what branch you enlist into but get everything you and the recruiter agree upon in writing before you swear in.
I enlisted into the Air Force a month before I graduated High School to avoid the draft in 1972 (last year for the Draft) and I took a 6 year enlistment and got everything I wanted and more like a term in Vietnam and a short stint in a POW Camp just north of Hanoi, after I was promised Germany or Hawaii, but the Recruiter laughed at me and now I know why. Good luck