What should one do if his underwear is arranged in such a way that he constantly feels an arousal during davening/learning. is it considered a חטא if he didn’t even want it to begin with?
It is nice that you are such an honest person, and don’t push things under the rug.
You are right, you didn’t want it in the first place, however if one’s underwear is arranged in a way that it is causing to get aroused, he has to get different underwear. There is a specific halacha regarding this, that one should not wear underwear that will cause such things even not during davening.
Rasbatz Nidda 14b, Piskei Riaz Nidda (Perek Kol Hayad) 25, Mishne Halachos 9- 268(9).