Having lived in Portugal for one year, I have compiled a list of things I did when returning to Japan permanently (upon departure).
Purchase of airline tickets
The sooner the better, I felt from my experience of returning home.
For instance, I had an internet provider contract with Vodafone. When cancelling this, they require proof of returning to Japan.
If you have the title deed or contract documents for a property you live in in Japan, that will suffice. If not, they will accept your return flight ticket as proof.
canceling the house contract
Depending on the contract, in my case it was sufficient to send a letter to the landowner at least 60 days before moving out.
As two-year contracts are apparently common in Portugal too, I wondered if I’d be charged a penalty for terminating early, but my contract didn’t include such a clause, so it was fine.
Also, make sure you have an IBAN ready for the deposit to be returned.
Termination of electricity (EDP) and water supply (EPAL) contracts
In Lisbon, you can cancel your electricity contract via EDP’s online portal and your water contract via EPAL’s online portal.
As the online process can take some time, it’s advisable to handle the cancellation in person at the service counter whenever possible.
That said, if a new tenant is moving in, it’s best to leave the contracts as they are. It’s considered courteous to vacate without cancelling, as this simplifies the new tenant’s procedures.
Cancelling a mobile phone contract
As I had an Amigo contract, I cancelled both subscriptions.
For further details, see here.

Internet disconnection
My internet contract was with Vodafone. MEO would have been fine too, but Vodafone was the only provider offering an internet-only contract, so I signed up with them.
When cancelling the contract, you must also return the rented router. For details, see here.

Cancellation of insurance
When applying for Portugal’s D8 or D7 visas, you must enrol in Portuguese health insurance.
Once you obtain your residence card, you may enrol in or switch to any other scheme of your choice.
When returning to Japan, remember to cancel this insurance as well.
Change of Address for NIF
Let us change your status from Portuguese resident to non-resident. You can complete the procedure at the Tax Authority (AT: Autoridade Tributária e Aduaneira).
(If necessary) Contact AIMA
To reside legally in Portugal, a residence card is required.
This is managed by the immigration authority, AIMA. Due to the large influx of immigrants, AIMA is currently overwhelmed, resulting in significant delays in issuing and renewing residence cards.
The processing time varies greatly: some receive theirs within two weeks, while others wait a year and a half before finally receiving it.
Therefore, if you suddenly need to return within a year, and your application is still pending, you should send a letter to AIMA withdrawing your visa application.
Summary
Moving abroad is tough when you’re actually doing it. I’ve really come to realise that the procedures in the destination country are the most difficult part. Leaving Japan is hard, but I imagine Portugal isn’t quite as challenging.
Even if I return to Japan, I’ll have to deal with procedures again, but it’s still easier in your own country.
