Does your koi have any external injury markings? It can be scratches, open wounds or you may not even see any external issues there.
If you see open wounds, it is definitely a bacterial issue. You need an anti-bacterial treatment. This can also be a secondary infection coming from parasites. So we need to examine the possibility of parasites too.
If you do not see any issues on the body, most likely it is the gills. I recommend you make the Koi sleep with Koi Sleep (https://www.kodamakoisupply.com/koi-sleep/) , and open the gill cover. I recommend you take pictures of the inside. Even if the Koi is already dead, I highly recommend you take the pictures of gills especially if you can not find external ulcers. Those pictures are helpful for your vet or koi dealer. As you make your Koi sleep, please check the bottom of the Koi too. You may not see wounds from the top, but the Koi may have something at the bottom.
Read more in our koi health checklist.