InshaAllah comes from the Quran, which tells the believer not to say of anything, 'I will do this tomorrow', without adding 'if Allah wills', and to remember his Lord when he forgets. The idea is humility: we plan and make effort, but the result is in Allah's hands. It is not meant as a polite way to avoid a promise. Some people use it that way, but that is a habit of culture and not the teaching, since the Quran also tells believers to fulfil their agreements.
Alhamdulillah is the second verse of the first chapter of the Quran, and Muslims say it for good news, after a meal, when answering 'how are you?' and in hardship as well, as a sign of trust. The Prophet Muhammad ﷺ taught that one who sneezes should say 'Alhamdulillah', and those who hear him say 'Yarhamuk Allah' (may Allah have mercy on you), to which he replies 'Yahdikum Allah wa yuslih balakum' (may Allah guide you and set your affairs right).
Bismillah ar-Rahman ar-Rahim, 'in the name of Allah, the Most Gracious, the Most Merciful', begins almost every chapter of the Quran. Muslims say it before eating, studying, travelling and starting any work, asking that it be done with Allah's blessing. When young Umar ibn Abi Salamah was eating carelessly with the Prophet ﷺ, he told him, 'Boy, say the name of Allah, eat with your right hand and eat from what is near you.'