BIG HUGS
I am very sorry for the bad news.
Here is our detailed guide for looking after a terminally ill piggy; I hope that it will help you in this most difficult time and to make the best of what you can and create some special memories while you still have him. It is a bitter-sweet time for you, but it is within your control just how bitter or how sweet this time is going to be.
The guide is also there to help you work through the grieving process, which starts the moment you get the bad news. It has different dynamics when you are looking after a terminally ill piggy but you have much more control over how you want to deal with it than with a sudden, unexpected death. The amount of grieving overall and the actual pain of the loss are not any less but you can control the guilt/failure factor and spread the emotional load for yourself so it is not quite the one huge impact wave that it is otherwise.
Apart from the onset (now), the most difficult time is always when you come close to the time for saying goodbye. The guide can hopefully help you with that, too.
A Practical and Sensitive Guide to Dying, Terminal Illness and Euthanasia in Guinea Pigs