I've written before about ways to set aside your emergency fund, including account types to use that allow you to access your money in an actual emergency, but that also set up "speed bumps" that make you think twice before you actually use the money.
Now I'd like to focus on a technique that you can use to set up a 3-6 month emergency fund while tackling your other goals. It's a simple tool that you can use to save over the course of a single 36-48 month assignment while serving on active duty.
It's called the 8% challenge, and it's very simple. Just set up an allotment from your military pay of 8% of your pay and put it into a savings account that permits check writing, but put the check book into a safety deposit box or a fire resistant box with your other personal papers. In the course of a year you'll save one month's pay (after tax). In three year assignment you'll have a three month emergency fund. Do that for two assignments and you'll have a six month emergency fund.
I recommend you also maximize your Roth IRA while doing the 8% challenge. If you can save more than that you can get pre-tax savings by contributing to the Thrift Savings Plan.
Once you have your emergency fund fully funded, revisit your retirement savings, or consider other goals such as saving for a new home, college savings for the kids, or a dream vacation.
The 8% challenge also teaches you the power of patience and goal setting, and by automating your savings using an allotment you'll ensure that you actually do pay yourself first.