I am stuck in an infinite tp loop and I don't know where the command block is and I also tried the server trick but It didn't fix it so what can id do now?
You can use
testForBlock command to search where the command block is placed (well, this command was then removed in Minecraft Java 1.13).
The syntax of the above commands:
/testForBlock <position: x y z> <tileName: Block> [dataValue: int]
Or you could use
gamerule command to disable command blocks in the map completely.
/gamerule commandBlocksEnabled false