When you use a preposition that tells "when," it will appear with ש if it comes before a verb, and without ש if it appears before a noun only. Examples:
I left before the party. יצאתי לפני המסיבה
I left before he arrived. יצאתי לפני שהוא הגיע
We will wait until he comes. נחכה עד שהוא יבוא
We will wait until tomorrow. נחכה עד מחר
He came after lunch. הוא הגיע אחרי ארוחת צהריים
He came after we ate lunch. הוא הגיע אחרי שאכלנו ארוחת צהריים
Hope that is clear.
The word לפני meaning "before, in front of" is a preposition which is pronounced "lifnéi". This is how the word is pronounced here.
Like many other prepositions and adverbs, you can add pronominal suffixes to it, and in that case it would be לפניי, meaning "before me, in front of me" and it would be pronounced "lefanáy". You can also do that for all the other persons - לפניך - "before you", לפנינו - "before us" and so on. Here you can look at the complete list: https://www.pealim.com/dict/6016-lifnei/