Standard disclaimer: I’m not a lawyer and this isn’t legal advice. If you need legal advice, you should… talk to a lawyer. Lucky for you, that’s exactly what this post is about.
If you do need a lawyer, your first stop should be on-base legal. Usually these offices have a baby JAG, fresh out of law school, with a few legal interns on staff. They can provide basic legal services – think drawing up a will or power of attorney and initial consultations. The exact process depends on where you are and the size of the base but generally you have to fill out a questionnaire and then schedule an appointment (often with a bit of a wait).
On-base legal will not represent you in out in town matters. They may write a letter on your behalf but they can’t / won’t do much beyond that. For those sorts of things you’ll need private counsel.
Let’s go over a few reasons you might need to see a lawyer (going in order of increasing trouble) and how to go about it.
Wills and estate planning
Having a will is just smart. It doesn’t take much and gives you a little extra peace of mind leading up to a deployment or TDY in case the unthinkable happens. An on-base lawyer can take care of this for you. Most of a will is boilerplate but there will be some decisions you have to make regarding who gets what and who looks after your kids if you and your spouse die. This is all very standard stuff and the attorney on your base will have done it a dozen times already.
Speeding tickets, other disputes, etc.

Put this in the category of nice to have. Sure, you can just pay a speeding ticket and take the points on your license but why? And there are times you really will need an attorney to look over documents when you buy or sell a house.
There’s a smarter / cheaper option than just paying out of pocket and that’s a legal plan from MetLife. This isn’t sponsored, just the most economical way to have legal representation.
It’s more or less like having a lawyer on retainer. When you need something, you can look up all the lawyers in your area who do that type of work and are in the MetLife plan and just reach out to one of them. They will ask you for a MetLife case number but won’t charge you anything else for most standard services.
There is a monthly fee but you can wait to sign up until you actually need a lawyer because it says in the fine print that previous incidents are covered. There are no deductibles or copays, if the service you are seeking is covered then an in network attorney is included in the monthly price. The basic plan works out to $14/mo and the “high” plan is $22/mo with the biggest difference seeming to be that the high plan covers pre-nups, juvenile court defense, adoption and immigration. So unless you have a niche situation going on, the basic plan would cover you for $168/yr (less than the hourly rate of some attorneys).
Divorce

Start by going to legal assistance on-base. Unless you are an E-nothing with no assets between the two of you with an amicable separation they refer you to someone out in town. They will probably have a couple law offices they can recommend or they will refer you to the BAR website for your state to find a reputable and recommended lawyer.
If you get arrested
Best practice is to let your chain of command know right away. Depending on the service there may be different reporting requirements but it’s always a good idea to tell your COC immediately.
In the Navy, for instance, you are only required to report the date of the arrest, arresting authority and what you are being charged with. The good news is that they can’t use that information alone to prosecute you.
You will be informed of your 31B rights. They will sound very familiar (like Miranda rights for civilians) and remind you that you have the right to protect yourself against self incrimination. In my limited experience very few do not talk. People are very eager to tell their side of the story. But these rights are there to protect you and you should not talk until you have spoken to a lawyer.
We won’t get into all the details of the military justice system but there is a punitive route (captain’s mast or NJP) and an administrative separation route (will still remove you from the service)
If you are accused, you will have access to Defense Services who will represent or advise you at a court martial or an administrative separation board. Most large military towns also have military specialty lawyers. These lawyers are mostly prior JAGs who are well versed with the military justice system but they come with a cost.
Cover your six
Obviously, the best way to lawyer up is not to need a lawyer in the first place but… stuff happens. When it does, or when you want to get ahead of the game, go see your on-base legal or get a legal plan.