Flying to the Comoros Islands isn't the cheapest way of travelling to the secluded country but it is the most time-efficient, however, there are almost no direct flights between the Comoros Islands and the rest of the world, meaning you'll have to make one stop in an African country first before boarding another flight that will take you to islands. There is only one international airport on the islands and that's Prince Said Ibrahim International Airport (located 20km north of Moroni, the capital city on Grand Comore) but it's extremely small with no ATM facilities and nowhere to exchange foreign change for local currency.
There are several airlines that offer weekly flights to and from Moroni including Air Austral, EWA Air, Kenya Airways, Air Madagascar, and Ethiopian Airlines, all with a stopover in countries such as Mozambique, Tanzania, Madagascar, Kenya, and Ethiopia. Since there aren't daily services available, it's recommended you plan and organise your trip well in advance to ensure you're able to secure flights on the dates you want.
The total travel time depends on which country you're coming from but you can safely expect the journey to take you upwards of 10+ hours if you're flying from the UK, 22+ hours if you're travelling from the US, and 13+ hours if you're travelling from Australia.
Make sure to prearrange your transportation from the airport to your accommodation before your flight lands as there's no public transport from the airport into Moroni and no WIFI. You can catch a shared taxi once you're outside the airport, however, it's not recommended you rely on this because it can be hard to communicate with some drivers unless you speak French.
Catching a boat to your final destination on the islands is a great way to travel if you're budget-conscious and have some extra time to spare, however, passage by boat isn't always reliable or guaranteed. This is mainly because the boats are actually cargo ships carrying produce to and from mainland Africa and the Comoros islands, and aren't solely for passengers. However, if you were to catch a boat, you'd still have to fly into an African country such as Kenya, Madagascar, Mauritius, or Tanzania, where you'll then be able to hop on a boat that sails to the islands.
Be prepared though as boat crossings are usually 3-4 days long and aren't always the most comfortable of journeys. But what this mode of transportation lacks in comfort, it makes up for in adventure with a whole heap of wonderful memories and stories to tell guaranteed.
There's not a whole lot of information about the ferry online, so you won't be able to pre-book your tickets, either going to the Comoros Islands or coming back from them. There's not even a regular schedule available or any guarantee the ship will let you pay a ticket for the crossing. It's best to investigate whether it's a viable option once you reach your destination in Africa.