Killing him might be really premature. Four years is old for a betta, very old, but he might not be ready to give up yet.

I only kill my fish as a last resort or when I suspect fish TB. If the fish seems to be seriously suffering from ulcers, body rot, ect. or if treatment has gone on an excessive amount of time with no improvement, I use clove oil.

You could try feeding him frozen/thawed peas that have been shelled and frozen food only for a week, see if that doesn't clean out his system and change his water more frequently.

If you haven’t killed him yet, are those his only symptoms? If so, it could be a simple case of constipation and/or SBD – Swim Bladder Disorder, which is quite common is fish.

If he is experiencing other problems, such as swelling and pine coning of the scales, that could be a sign bacteria is attacking him internally or his kidneys have failed. If he is pine-coning, euth him right away, there’s almost NEVER anything you can do at that point and after that he’s just suffering needlessly.