Questions & Answers about Foi um prazer.
- foi = was
- um = a
- prazer = pleasure
So the structure is very close to English: was + a + pleasure.
A key thing to notice is that Portuguese does not need to say an explicit it here. English says It was a pleasure, but Portuguese simply says Foi um prazer.
Foi is the preterite (simple past) form of the verb ser (to be) for ele/ela/você.
In this expression, it refers to a completed situation, such as:
- meeting someone
- talking with someone
- being helped by someone
- finishing an interaction
So Foi um prazer sounds natural because the pleasant interaction is now finished.