When I decided to have my first child at 22, it wasn't the most financially responsible decision I had ever made. In fact, the cost of raising a child was something I only fully realized once I was pregnant. I prayed I wouldn't need an exorbitantly priced c-section, because we were already stretching our budget just trying to buy the bare necessities. While I didn't end up requiring surgery, I did spend a week in the hospital with my jaundiced newborn, racking up thousands of dollars in medical debt with each passing day.

Having a child while young and poor immediately put me in debt, but it also gave me the motivation to become financially literate and get my act together. I doubt I would be in the secure financial position I am in now without that experience. Even though my cost of living would be lower had I remained childless through my 20s, my resolve to be financially responsible would be as well. It was a learning experience, and one I wouldn't trade for anything in the world.

Here are a few of the financial lessons I learned from having a baby at 22.

1. It pays to be prepared

For as long as I could remember, my father would harp on me about how I needed to have an emergency fund. The concept sounded good in theory, but I could never seem to muster up the cash to spare. When I was young and indestructible, it was hard to convince myself to keep a large pile of cash just sitting there, waiting for disaster to strike.

That feeling of invincibility lasted right up until I got pregnant and started researching the cost of giving birth. Pregnancy seemed to be an emergency in and of itself, and I wasn't ready for it. We saved tirelessly over those nine months, barely making it to the point where we could afford an uncomplicated birth. Then my son had to spend a week in the hospital and the bill was devastating. We weren't able to pay it off for nearly nine months after my son's birth, at which point I decided it was definitely time for that emergency fund. It took us two years and a lot of sacrifice, but it has been well worth it. From ER visits to car troubles, that rainy day fund has saved us from debt time and again.

2. Thinking ahead is key

When my son was little, I bought him a lot of unnecessary things. Toys he barely played with (if at all). A baby swing he outgrew in three months. A bouncer he outgrew in two. Baby food gadgets of all shapes and sizes. When I found I needed to purge our belongings every couple months, I started to realize that maybe I needed to think more long term with my purchases.

My second and third kids had a much more "edited" collection of toys and other accoutrements because I never bought anything without asking myself if and when it would end up in the donation box, and how badly we really needed it. In fact, having kids moved me much closer to minimalism, you know, once I got rid of all their excess stuff.

3. You don't have to buy everything you need

When I was pregnant, we were too poor to go on a shopping spree for our baby. That ended up being a good thing, because I would have bought every last necessity as soon as I saw those two pink lines had my budget allowed it.

But it turns out, you really don't need to buy everything you need. People came out of the woodwork wanting to get rid of their baby stuff when I announced my pregnancy. Baby swings, bouncers, bassinets, strollers, nursing pillows, high chairs — you name it — someone out there is looking to get rid of it. Ask your friends and family for things before you buy, or get on Craigslist before spending full price. That doesn't just go for baby items, either. Looking secondhand first is a great way to save some cash.

4. Money isn't everything (but it sure does help)

The early years of my son's life were not easy financially. My "choice" to stay home was hardly a choice at all because my husband and I couldn't both work retail hours and still find or afford daycare to fit our erratic schedules. We had to sell our car to pay off medical debt. We would walk to the grocery store and make refried beans and bread from scratch. During those days of barely scraping by, I decided to start keeping a gratitude journal to remind me of how good I had it. Life was hard without money, yes, but it was also good. Money wasn't the end all of happiness.

As my husband and I grew in our careers, we were able to live more comfortably, and I saw how much money really did help when you have kids. (No stress about paying for labor and delivery! Being able to buy ready-made food for the postpartum period!). Still, I never look back on those years and regret the struggle, because it has given me perspective in spades.