Start off by putting up some pics of your engine, including your throttle mechanism. Right now, we are assuming that you're using a traditional horizontal shaft industrial engine that shipped from the factory with a hand-controlled throttle lever, tied into the engine's governor system.
You will need to connect your kart's foot throttle to that hand lever mechanism. In addition, you will need to loosen off that hand lever a bit so it will move freely and not stay at a fixed setting. you will have to install 2 return springs- one at the pedal, and one at that hand lever, so that when your foot is not on the pedal, the throttle always returns to the idle position. If, after all this, your engine is still idling too high and causing the kart to want to drive away on it's own, you will need to adjust the idle stop screw on the carburetor.