How do you "control" for a factor/variable? To my understanding, "Control" can have two meanings in statistics.


*

*Control group: In an experiment, no treatment is given to the member of the control group. 
Ex: Placebo vs Drug: You give drugs to one group and not to the other (control),  which is also referred as "controlled experiment". 

*Control for a variable: Technique of separating out the effect of a particular independent variable. Some of the other names given to this techniques are, " accounting for", "holding constant", "controlling for", some variable. 
For example: In a Football viewing study (like or not like),  you may want to take out the effect of gender as we think gender causes bias, that is, male may like it more than female.  
So, my question is for point (2). Two questions:
How do you "control"/ "account for" variables, in general. What techniques are used? (In terms of regression, ANOVA framework). 
In above example, does choosing male and female randomly constitutes control? That is, is "randomness" one of the techniques for controlling other effects?
 A: As already said, controlling usually means including a variable in a regression (as pointed out by @EMS, this doesn't guarantee any success in achieving this, he links to this). There exist already some highly voted questions and answers on this topic, such as:


*

*How exactly does one “control for other variables”?

*Is there a difference between 'controlling for' and 'ignoring' other variables in multiple regression?

*Explain model adjustment, in plain English
The accepted answers on these questions are all very good treatments of the question you are asking within an observational (I would say correlational) framework, more such questions can be found here.
However, you are asking your question specifically within an experimental or ANOVA framework, some more thoughts on this topic can be given.
Within an experimental framework you control for a variable by randomizing individuals (or other units of observation) on the different experimental conditions. The underlying assumption is that as a consequence the only difference between the conditions is the experimental treatment. When correctly randomizing (i.e., each individual has the same chance to be in each condition) this is a reasonable assumption. Furthermore, only randomization allows you to draw causal inferences from your observation as this is the only way to make sure that not other factors are responsible for your results.
However, it can also be necessary to control for variables within an experimental framework, namely when there is another known factor that also affects that dependent variable. To enhance statistical power and can then be a good idea to control for this variable. The usual statistical procedure used for this is analysis of covariance (ANCOVA), which basically also just adds the variable to the model.
Now comes the crux: For ANCOVA to be reasonable, it is absolutely crucial that the assignment to the groups is random and that the covariate for which it is controlled is not correlated with the grouping variable.
This is unfortunately often ignored leading to uninterpretable results. A really readable introduction to this exact issue (i.e., when to use ANCOVA or not) is given by Miller & Chapman (2001):

Despite numerous technical treatments in many venues, analysis of
  covariance (ANCOVA) remains a widely misused approach to dealing with
  substantive group differences on potential covariates, particularly in
  psychopathology research. Published articles reach unfounded
  conclusions, and some statistics texts neglect the issue. The problem
  with ANCOVA in such cases is reviewed. In many cases, there is no
  means of achieving the superficially appealing goal of "correcting" or
  "controlling for" real group differences on a potential covariate. In
  hopes of curtailing misuse of ANCOVA and promoting appropriate use, a
  nontechnical discussion is provided, emphasizing a substantive
  confound rarely articulated in textbooks and other general
  presentations, to complement the mathematical critiques already
  available. Some alternatives are discussed for contexts in which
  ANCOVA is inappropriate or questionable.


Miller, G. A., & Chapman, J. P. (2001). Misunderstanding analysis of covariance. Journal of Abnormal Psychology, 110(1), 40–48. doi:10.1037/0021-843X.110.1.40
A: To control for a variable, one can equalize two groups on a relevant trait and then compare the difference on the issue you're researching.
I can only explain this with an example, not  formally, B-school is years in the past, so there.
If you would say:

Brazil is richer than Switzerland  because Brasil has a national income of 3524 billion $ and Switzerland just 551 billion

you would be correct in  absolute terms, but anyone over 12 with a passing knowledge about the world would suspect that there's something wrong with that statement, too. 
It would be better to elevate Switzerlands population to that of Brasil and then compare income again. 
So, if Switzerlands population was the size of Brazils their income would be:
(210 million / 8,5 million) * 551 billion dollars = 13612 billion dollars
This makes them about 4 times as rich as Brazil with 3524 billion dollars.
And yes, you can also take the per capita approach, where you compare average incomes. But the above approach, you can apply that several times. 
