There are two separate approaches here, and they suit different people. Traditional call forwarding is set up through your home carrier, either in their app or with a dial code, and redirects incoming calls to your local number abroad. It works with any phone, but you generally pay international rates for the forwarded leg of every call, so it gets expensive if you receive many calls. Check your carrier's forwarding charges before enabling it.
The modern alternative is a virtual number service. Apps in the Google Voice family give you a number that rings over any data connection, so calls and texts reach you anywhere in the world at no roaming cost.
A lot of expats settle on a hybrid: home SIM kept alive in a dual SIM phone purely for bank SMS codes, local SIM for daily life, and a VoIP app for anyone who insists on calling the old number.