When you're stuck in an office working 9 to 5, you may be dreaming of the day you get to finally retire. Imagining yourself sitting on the beach or just sitting on the couch, you're already counting down the days until retirement.

And while you may wish that you could retire early, most people realize they probably won't be able to leave the workforce and enjoy a comfortable retirement until well into their sixties. The only way they can retire early, they think, is to win the lottery or inherit a million dollars from a long-lost rich relative.

couple sitting on dock watching the sunset

Image source: Getty Images

However, early retirement doesn't have to be something that's reserved for the ultra-wealthy -- even the average employee can retire early with some hard work and a lot of dedication.

First, though, let's clarify that although it's possible for the average employee to retire early, most people will not be able to live the lifestyle required without some serious commitment. While you don't have to be earning a six-figure salary, those living on the minimum wage will likely not be able to save enough to retire at age 40. And because you'll need to invest heavily, you'll have to make sacrifices to put a decent chunk of your paycheck toward your retirement fund.

Think you're up for the challenge? If you're ready to ditch the cubicle and retire early, here's how to get started.

Define what "retirement" looks like for you

The first thing to do is consider why you want to retire. Are you sick of setting an alarm every morning? Are you wishing you could spend more time at home with your kids? Maybe you've always wanted to travel and are feeling chained to your desk?

If that's the case, you may be able to "retire" while still working. If you just want to travel, for instance, you may choose to save as much as you can before quitting your job, then as you travel the globe, pick up odd jobs in your current city to help pay the bills. Or if you just want to be home more often, find a part-time work-from-home job after you "retire" from your full-time position.

Most people think that once they leave the workforce, they'll have to already have saved enough to last them the rest of their life. While you should have saved a significant amount by the time you retire, being willing to continue working on at least a part-time or flexible basis can make early retirement a lot more attainable.

Map out your financial future

Once you've decided whether or not you want to work at all once you retire early, the next step is to determine how much you'll have to put toward your retirement fund each month in order to reach your goal.

Let's look at a hypothetical example to see this financial map in action.

Say, for example, you're 25 years old and want to retire at 40. You're earning $40,000 per year, but once you retire you want to continue working part-time and estimate you'll be earning half your current annual salary.

Plug your numbers into a retirement calculator, and if you're planning on working during "retirement," be sure to adjust the percentage of income replaced during retirement (your percentage will be lower if you're working part-time, because you have that extra money coming in to add a buffer to your savings).

In this example, you'd need to save 41% of your income to retire at 40, which amounts to $16,405 per year or $1,367 a month. This also assumes an 8% annual return on your investments both before and after retirement, a 3% inflation rate, a retirement that lasts 40 years, and an income replacement of 50%. It also doesn't consider Social Security benefits, which may add some extra padding once you reach the full retirement age and become eligible.

If you wanted to enjoy a "real" retirement without working part-time, assuming you want to replace 100% of your income upon retirement, you would have to save 82% of your yearly income, or $32,810 per year. Unless you have very minimal living expenses, this won't be attainable for most people.

Decide how badly you want to retire

Once you know what you'll need to be saving each month to reach your retirement goals, you'll have to make a choice about how eager you are to retire.

Saving the bulk of your income each month will require major sacrifices, and it's even more difficult the older you are or if you have a family depending on you. But that doesn't mean it's impossible.

Early retirement is within reach if you're prepared to do some serious saving. If you have a dream of spending your forties (and beyond) relaxing on the beach far away from your cubicle, that dream can become a reality -- if you're willing to work for it.