When doing a titration, for example acid base, how do you know how much base to measure out and how much analyte to pour in the reaction flask?

It really doesn't matter as long as you use reasonable amounts. The trick is that amount stuff in the flask must be know EXACTLY (you can't measure it with a graduated cylinder). For the stuff in the buret, I make a habit of filling the buret to the top every time. At the end of the titration you read the buret and that is the amount added.