I accidently made a /kill loop on minecraft and can't get anywhere near it too stop

I accidently made a /kill loop on minecraft and can't get anywhere near it too stop, help?!

If you are running this world on a multiplayer server, you can disable command blocks completely via the server properties. Shut down the server, open server.properties with a text editor of your choice and set
enable-command-block = false

This disables all command blocks. Join the game, destroy the command block in question and reenable them afterwards.

In singleplayer, it's a bit more complicated. You have to open the world as a multiplayer* server. Open server.properties and set
level-name = [relative path to your savegame]

e.g. Saves/world (use / to divide folders).

Also world edit could help a lot, just delete the command blocks through there.