Yes of course you have to know it, how else would you know how a word is pronounced?
You have the option to learn zhuyin instead, but this is more useful if you’re planning to learn traditional Chinese.
Be careful when learning pinyin though, how it looks like in English isn’t necessarily how Chinese people pronounce it. For example xia, is pronounced more like shia.