I was in namaz and suddenly I felt like I had to hold the urge to release wind. Later on as we went I heard a sound and then felt a sort of release of some pressure around the rectal area and as soon as the sound when the pressure lowering stopped. It happened again after and I began to think I released gas. I was thinking about the hadith that if you hear a sound or smell something, in this case I heard a sound and felt some pressure released around the anus area. I'm not sure what to do, whether I have to read the prayer again or not and how to read the prayer if I do have to. Please help.
There is no confusion, you heard it, felt it, and were actively trying to hold it down. So it is plainly obvious that you actually passed wind. So redo wudu and pray that prayer again.
That hadith is about OCD thoughts, some people, whenever they move they think they might have passed some wind and this goes on constantly.
I passed through this phase once, whenever I washed my feet in wudu I felt like I had passed wind and had to redo wudu again and again, I spent hours trying to do wudu.