Once in a while, upon passing gas, I find that I have soiled myself very slightly. do I have to be choshed every time I pass gas that I am dirty, and not daven or learn? what about in the middle of shemoneh esrei.
No you do not have to be choshesh for this unless you find it often and this is your norm, then you would have to check. However, if that isn’t the case, (and usually by most people it isn’t) then you would be able to feel when it is problematic and when it isn’t, and if you don’t have specific reason to be choshesh, you don’t have to, and continue davening or learning. It is important not to get nervous and OCD about this because the yetzer hora will be able to disturb all or your tefilos this way.
Shulchan Aruch O:CH 101-1,2 discusses the halacha of a person that passed gas while davening shemona esrei, that he waits until the odour dissipates and then he can continue davening. He doesn’t say that one has to check himself first before continuing. See Meir Oz on that seif. And Yalkut Yosef O:CH 1 pg. 255 ftnt. 3. Nachlas Avrohom pg. 464 ftnt 25.