As a 40K player, you almost certainly fall into one of two groups. One, you're a "veteran" player who has seen at least one edition change in the core rules and more than likely (certain armies like Dark Eldar aside...) has seen at least one change in your particular army's codex. Or two, you're a relatively new player who hasn't been through the turmoil of edition changes yet.
Either way, there's a good bit you can do to protect yourself against that turmoil. More than likely, Games Workshop will continue to change the core rules every 4-6 years and periodically update codexes. So, what can you do?
You have a few choices.
1)
Ignore the changes - If you mainly play with a small group of similarly-minded players, this can work. I'm sure that there are groups out there that still play 4th, 3rd, 2nd ed or even Rogue Trader, or play 5th edition rules using 3rd ed codexes, etc. But if you play out in the larger world or plan to attend outside events like tournaments this strategy won't work too well.
2)
Buy lots of new stuff each time things change - There's a new uber-unit in the new book? Buy three. This other unit isn't as good anymore? Sell it or put it in storage. If you have the money to do so and the time to put it all together/hopefully paint it this can work for you. Some even enjoy retooling their army periodically, like replacing their engine for optimal performance. But if you have limited money or time, this may not be the best strategy for you, rebuilding the same army at 1500-2000pts over and over again over the years.
So we can either ignore the changes or throw ourselves into them. Can we find a middle ground? Yes!
3)
Plan for the long haul - Warning: this usually won't result in you having the "best", most competitive force out there. It is however designed to hopefully give you an army that will transition rule and army changes as smoothly as possible, allowing you to continue playing your army with a minimum of adjustment/unit changes.
So how to prepare for the long haul?
1)
Pick an army you really like - Don't just pick an army because you think their current rules are powerful - if you do, there's a significant chance when the rules change you'll be disappointed and will have a greater likelihood of shelving or selling the army at a loss. Rather, pick an army that you like the
idea of, that you like the story of, the look and feel of the army. If you love the army, you'll continue with them over the years rather than dumping them and sniffing around for the next daemonette.
2)
Stay centered as much as possible - Each army has a core that will most likely continue throughout future changes. The closer to stick to that, the easier your transitions will be. When preparing for your new army, don't just look at the current book - take a peek at the previous ones (generally 3rd ed on) to see what types of units generally stick around. If you don't have the books already, ask around in your local group or you can probably find outdated codexes cheap online. So for Space Marines for example if you build an army with a core of tactical squads, some terminators, an assault squad and some vehicles you could probably build that force with a minimum of fuss in any of their books from 3rd ed to the present. The easier your proposed army would fit into earlier books, the likelier it is to fit more easily into future editions as well. This does mean however that army builds that go strongly in one direction may have a hard time adjusting - the more extreme you build in one edition, the greater your likely adjustments for future ones. If you really like lots of Nob Bikers, or Sternguard, or the rules granted by a particular special character like Vulkan, by all means make that army. Just don't be surprised when things change in a few years.
3)
Take your time modeling and painting - This one has nothing to do with rules changes directly. However, no matter how well you "center" your army, you may end up having to make minor changes, or decide that you want to add a new unit to your collection when that spiffy new kit comes out. Over time, you'll be getting more hobby practice in and your painting and converting skills will naturally improve over time. If your earlier efforts are sloppy and rushed, the new unit done at your new and improved skill level will look out of place with the rest of your army. If your earlier efforts are well done (for your skill level at the time), that new unit may still stand out, but it will be as a centerpiece rather than an anomaly. Be patient with your painting, and try to do what I fail to do - keep notes on what you did to achieve colors/effects - note down what paints/washes you used, what mix ratios, etc. Take a few minutes early on instead of trying to remember how you did it five years later! Of course these days, putting such things up on a blog or a project log on a website can work as well, but I'd also put it down on paper somewhere too, just in case that site goes under down the road (heaven forbid!).
4)
Keep your options open - Purely modeling advice, but it can save you frustration and money. Where possible,
magnetize! Being able to turn your Predator Annihilator into a Destructor or your Rhino into a Razorback at a moment's notice can save you lots of hassle down the road. Aside from sponsons, etc. consider magnetizing various upgrade uptions, like hunter-killer missiles, havoc launchers and the like. Not only does this make WYSIWYG easy, it's also an easy way to represent destroyed weapons by just pulling them off! You can also do this with infantry models also, enabling you to swap out a meltagun for a flamer, etc. Also, keep a "bits box" - don't throw anything away! Next edition you may want those extra plasmaguns, jump packs or whatnot you're not using right now. Third bit of advice, which ties into the other two - where possible buy the "bigger" kit. Check out contents on various vehicles and see what you're getting. A lot of the time you end up with more for your money, like buy a Razorback kit for $5 more than a Rhino kit - you can still make a complete Rhino, but you also have the option for a Razorback and/or have extra parts to use for other conversions.
A couple of examples from my own armies:
Space Marines: My Silver Skulls were my first completed army upon my return to 40K in mid-3rd edition. Using the 3rd ed codex, I built them as a full drop-pod force, back in the days when drop pods didn't have models or fancy rules to keep you alive while deep-striking into dangerous positions. I had a number of power-armored squads, a land speeder and two dreadnoughts.
Today I have a number of power-armored squads, a land speeder, and two dreadnoughts.
What had to change? I added a few figures and consolidated squads in order to bulk up the squads to ten men each from the prior seven each, giving me 5 ten-man squads instead of the old 7 seven-man squads. With the option to break up the units into combat squads I can still cover a lot of real estate. I also needed physical drop pods. End result, my actual unit choices were pretty "core" and required minimal changes. My army style - all drop-pod, was extreme for the time and was vulnerable to the change requiring physical pods on the table. Thankfully, some cheap scratchbuilds later and I was ready to go. I decided later to swap out my scratchbuilds for other (though non-GW) models, but I didn't really have to. The army also grew points-wise from 1500 in 3rd ed to 1850 in 5th, with the bulk of that increase coming from the cost of the pods themselves.
Chaos Marines: I started planning my Word Bearers out under the 3.5 version codex. I planned on a couple of squads of basic Chaos Marines with Rhinos, an infiltrating squad, a Daemon Prince, some terminators, dread, defiler, and a couple of squads of Flesh Hounds. Then the 4th ed codex came out and I had to redesign them.
What had to change? Despite the general internet doom and gloom about the 4th ed Chaos codex, not much changed. My Prince wasn't as powerful, but became a good bit cheaper. My regular squads were pretty much OK, and my infiltrating squad morphed into Chosen. Flesh Hounds were gone, but I could still use the models as generic lesser daemons - not as powerful or fast, but significantly cheaper. The extra points saved helped pay for a vindicator, a new option for non-Iron Warriors armies. When 5th ed rolled around the Chosen got an extra treat with the option to Outflank, and the Daemons carried over as cheap scoring units in the Troops-only scoring environment. If I had opted for something like an Emperor's Children force with maxed-out sonic Havocs or something similar I'd have been much more put out.
So do what you can to plan ahead! As they say, the only constant is change, so be aware and prepare!