is deep breathing helpful as a tool to keep the sex thoughts away?
Yes, definitely! I remember applying this method one day at work years back, when fantasies (with physical arousel) were coming up strong based on some stuff I saw, and I would nonjudgmentally dismiss the urges and fantasies as I breathed deeply. You can feel yourself calm down. Then (as may occur) when the fantasies and/or urges return, just repeat the process.
Being mindful and nonjudgmental is extremely important here. Think of it like you're stepping outside of yourself in the moment, and compassionately viewing yourself without judgement. Focusing on your breathing will take you out of your head, and make you more mindful, more in the present moment.
You'll find that you can outlast any urge/fantasy.