In case you take the boat, the nearest ports are those of Heraklion and Sitia. From Heraklion there is a connection of the KTEL herlas (bus) towards Sitia, while from Sitia you should transfer from the bus station to the bus heading towards Heraklion and stop at Hamezi.
Information on KTEL routes in the prefecture of Heraklion-Lassithi can be found at the following link: https://www.ktelherlas.gr/el/
The nearest airport is that of Sitia and then Heraklion. There are routes from the airport of Heraklion "Nikos Kazantzakis" to Sitia with the bus, while from Sitia you should get to the bus station in the city center and take the bus to Hamezi.
To go from Sitia to Hamezi you can also use a taxi. phone +30 2843020420