The word 先輩 [senpai] means something like "senior (at work, school, etc)". It's a word to refer to someone who is in a similar rank or position as you but who entered that rank or position before you did and therefore deserves a bit more formality.
Sometimes people write 先輩, which in hiragana would be written as せんぱい, in English letters as "senpai", and sometimes they write "sempai".
Which is correct?
Several years back, I had a conversation with a reader about this very topic.
Me: You can write it "senpai" or "sempai". Japanese people tend to pronounce it as "sempai".
Reader: My Japanese girlfriend just said they say senpai, not sempai. She's actually very confused about this article. She said, "Semupai? We don't say only 'm' in Japanese."
Me: They say せんぱい, which in romaji is senpai. I agree. When your lips touch, however, the "n" sound is technically an "m" sound, and your lips have to touch to make the "p" sound in ぱ. So the "n" sound becomes an "m" sound, technically speaking.
So "n" ん is sometimes pronounced "m"?
Yes, when it comes before a p-, b-, or m- sound.
Is ん even pronounced "n"?
Not in the way that you pronounce "n" in most English words.
ん is closer to the "n" sound in "king".
You'll notice that it sounds a bit nasally when native speakers say it.
I still mess this up a lot and "over-pronounce" ん, to speak, making my Japanese sound less natural.
Official English spellings of Japanese words
A lot of the Japanese words you're familiar with will use the letter "m".
- 天ぷら [てんぷら // tenpura] is "tempura" (seafood or vegetables deep-fried in a light batter)
- 新橋 [しんばし // shinbashi] is "Shimbashi" or "Shinbashi" (a neighborhood in Tokyo)
The best way to improve your pronunciation
Use Shadow Loops at NativShark. They are repeated loops of Japanese sentences spoken by native speakers at natural speed.
Pay attention to how they say each sentence. Try to match your own speech to theirs.
If you're handy with audio editing programs like Audacity or Audition, you can make these yourself from any Japanese audio file.
It's a hassle, but bonus points if you also record yourself and compare the audio side-by-side.