The P0401 error code specifically means you have "reduced flow" in your Exhaust Gas Recirculation system. A stuck and ruined EGR valve will certainly cause reduced flow, but clogging anywhere along the EGR route can cause the same reduction. There is a very technical explanation of the system, its flow and the analysis your engine's computer goes through to arrive at the decision to turn on that Check Engine Light here if you want the nuts and bolts of it all. The fact is there are any number of points along the route of the exhaust gas that can clog up and restrict flow, and all you need to do is clean them to restore the system to its full capacity, and turn off the light.
But what do you need to clean? It's a good idea to disconnect any part of the EGR system that appears easily serviceable and clean it thoroughly. Remember to let your engine cool thoroughly before doing any service like this. The exhaust gases are very hot and it can take some time for your engine components to cool down after heating up to full operating temperature. Safety first we always say!
Disconnect any electictrical connections to your EGR valve before taking things apart for a cleaning. You'll be removing the valve itself so you'll be disconnecting everything. It's always a good idea to start with the electrical harnesses to avoid accidentally pulling on any of the delicate connections that are under the hood. Push the wiring safely out of the way then proceed to the dirty part. Your EGR valve has a large vacuum hose connected to it, so disconnect that hose first using the hose clamp. If it has a crimp type clamp, you'll have to throw it away and replace it with a screw or spring type hose clamp because the crimpies aren't reusable. Remove the EGR valve itself and you can clean it. There's a very loose test you can perform on the EGR valve when it's off the engine. Shake it. If you hear the valve inside opening and closing, this means that it's still working and that you can probably get away with a cleaning to get things back in order. If you don't hear it shaking in there, there is less chance that it will recover, but I'd still give it a try! You can't hurt a stuck EGR valve by cleaning it, right? Read the instructions on how to clean your EGR valve to see how easy it is to give it a thorough cleansing inside and out.
Cleaning the rest of the system is simply a matter of removing any black stuff that has accumulated in the plumbing of the system. You can do this with carb cleaner. If you can take some of the hoses out and soak them, this helps. If not, just give them a good soaking inside with the carb cleaner, then a soft wire brush, pipe cleaner, or small rag to wipe it through. WARNING: Be sure to wear eye protection when spraying carb cleaner. It can end up in your eye when you least expect it!
Once you given the system a serious cleaning, reassemble it and start driving. You'll know within a day or so whether you are still having a clogged EGR problem. If it turns out you still need to replace the EGR valve, go ahead and do it. But there's at least a 50% chance you've solved your problem without spending any cash at all!