Learning to not trigger the shuffle is as easy as stopping to ask yourself "does playing this actually benefit me" before playing each card (and not playing it if the answer is no).
Making correct buying decisions is a lot less trivial. It's a good idea to move away from the "I have X coins, let's see which card I can buy for X, oh, there's Village, that seems nice, I'll get that" line of thinking and instead start thinking in terms of deck composition and the needs of your overall strategy. If you're playing an engine strategy, for example, you need trashing early, a good balance of engine components in the early-mid game and payload and more engine components in the late-mid game. So, after deciding that engine is the best strategy in the kingdom, you should usually think along the lines of "I need trashing now — how can I get it?" and if it's the case that the trashing in the kingdom is more expensive than you can afford right now, plan ahead and buy cards that will help you reach the more expensive price point early. And in the early game, you should consider how you're going to acquire the engine parts later; you might need some economy for that, or you can use gainers to gain them, or you could use cards such as Wishing Well that are less efficient at giving you coins to spend, but won't get in your way later.
Basically, you should just have an idea of what your deck needs and how you're going to get what you need. The point is focusing on the deck and the purpose the cards serve in it, rather than the individual cards and their strengths.