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.
This is a very common learner question.
Both foi and era can translate as was, but they are used differently:
- foi = completed event, viewed as a whole
- era = ongoing/background description, habit, or a more open-ended past situation
In Foi um prazer, the speaker is treating the interaction as a completed event:
It was a pleasure.
Using Era um prazer would usually not fit this situation. It sounds like you are describing a past state rather than politely closing a finished interaction.