Madagascar is well equipped with mobile telephony with the providers Orange, Telma, Airtel. The network works almost everywhere in the country except of course in very remote places.
You can buy a SIM card in the many kiosks. You will thus have a Malagasy number with data to connect to the Internet, a Whatsapp connection and you will be able to call and be called from abroad.
Most hotels offer free WIFI. Sometimes in the rooms/bungalows, but more often in the common areas of the establishment.
Don’t forget your charger! Electrical outlets in Madagascar are like French outlets: Type C and E. For all other outlets, provide an adapter.
If your trip takes place in isolated areas where electricity is rare or non-existent, provide an external battery (powerbank)