DS cartridges are usually repairable rather than replaceable, and the fault is often just dirty contacts. Try blowing out the slot, cleaning the connector edge of the cart with a dry lint-free cloth, and testing the game in another DS to confirm which piece is at fault.
If that fails, a specialist console repair shop is the next step. I tried a do-it-yourself approach on my own DS without much luck, and ended up at an electronics store in Cabramatta, Sydney, who sorted it out quickly and cheaply — well worth it for the saved console.
Whatever you do, avoid scraping the contacts with anything metal. That turns a small problem into a dead cartridge.