So sorry for the loss of you long time tank companion. Just like with all living things, there are the fun times and the hard times in the circle of life.
In the case of a ill fish or one with a condition you do not know about or comes on suddenly, often there is nothing that can be done. You can check up on what it might be and sometimes it can be helped and sometimes not.
If your water conditions are good with the test, I would still do a partial water change equal to what you might normally do or a little more. and continue on the regular schedule of water changes to keep the water fresh.
If he had a blockage other than constipation you wouldn't have been able to help him much other than put him down but how would you know?
Cooked peas are something which helps the fish with constipation.
I have not seen this exact thing before and not too sure what else other than trying peas.
Always check to be sure that the water conditions are safe by testing it if you have a fish that doesn't look right to you, or isn't acting well.
New to FW fish? First tank in a long time or EVER??? Need some info on keeping fish?
Start here - Aquarium Advice Article
FW Favorites right now Clown Loaches, any shrimp - SW Vase Red Mangroves