According to Islamic belief, Allah sent Prophets and Messengers to the humanity in order to transmit the noble meanings and guide the societies to believe in Allah and to behave morally. The first Prophet was Adam (Peace Be Upon Him) and the last Prophet was Muhammad (Peace Be Upon Him and His Family). The Prophets and Messengers are chosen by Allah, and hence they are purified and considered the real models of worshipping Allah and behaving in the right manner.
Notably, there is a difference the Prophet and the Messenger. Similar to the Prophets, the Messengers were sent by Allah. They have a divine message to deliver to the humanity. However, the Prophets are those who receive revelation from Allah. Thus, every Messenger is a Prophet, but not every Prophet is a Messenger.