Step 1: SAVE when you spot it. If it runs, you can retry. Step 2: Learn to counter. If you can counter it's attacks perfectly, it'll fall over, and not escape. Step 3: Spam Luiginary Atttacks that deal damage based off boots or hammer. I find Luiginary Hammer to be an effective tool in taking down the Gold Beanie.
http://pokefarm.org/_ext/user/Polimario#0 "Imagine how much worse it would be if the Metal Heads were in charge!" - Baron Praxis