This is a problem I've had in my creative world.
Recently, I was stupid enough to teleport myself to somewhere about 100k blocks from spawn in the overworld and try to kill the ender dragon.
It didn't turn out well because it quickly flew away faster than I could kill it.
It turned out that it flew into unloaded chunks and I couldn't chase after it.
I know ender dragons can fly to spawn in the overworld, and I have tried
/kill @e[type=Minecraft:ender_dragon], however, it hasn't worked.
I am scared that it will travel to spawn, and destroy my builds. However, even if it doesn't as it is in unloaded chunks, I would like to remove it from my world. I roughly know the coordinates where it flew to but I don't know exactly. If possible, I would prefer to not fly out and find it again.
It may have already despawned but I'm not too sure. Any help to remove it would be greatly appreciated! :D