Why and how did Italian lose the final s consonant in words,while some romance languages like spanish and portuguese retained it?(e.g. spanish "pues" and italian "poi").Is this phenomenon related to the loss of final consonants in french?
Italian did not lose the final s: it turned it into a [j] (what English speakers call "the y sound"). So for example, the Latin word post lost the final t in proto-Romance, becoming **pos*, that became pues in Spanish, poi in Italian and puis in French, all quite regularly.
This is less apparent due to the subsequent reduction of diphtongs (e.g. unstressed [aj] becoming [e]), but it is still visible, if you know where to look.
Examples of this process are all across the Italian lexicon: you can see it in the plurals: canes > **canei* > cani, capras > **capraj* > capre (although this was likely influenced by the nominative plural of the second declension). You can also see it, maybe less evidently, in the second personal singular ending of verbs: sedes > **sedej* > siedi, amas > **amaj* > ame (that got later regularized into ami). However compare with das > dai: the stressed diphtong has been preserved.
To my knowledge, this has nothing to do with the loss of final consonants in French.
Source: Maiden, M. (2014). Linguistic History of Italian, A. Routledge, section 2.12