There are going to be dozens of opinions on this, so keep in mind that I'm only talking in generalities:
Don't get too caught up on what type of terrain you're on, flat, uphill, downhill, etc. As long as you're exerting yourself on your bike, try to take deep, steady breaths, breaths that seem to go clear to your stomach. Try to focus on keeping your breath steady whenever you can. Try a few different rhythms and see if you can pick one that comes most naturally. Even better, see if you can find a riding buddy so that you two can exchange notes and learn from each other.
There are people who make their career out of training people how to breathe, so, this is just to get you started.