There are essentially two general tips on constructing context-free-grammars. A wide range of normal context-free languages (those that do not require any tricks) have easy grammars for them. And the tricky one that are present in relatively hard exercises are relatively few and these involve knowing some finite number of tricks to construct grammar for them.
Of course the following two tips won't cover all the problems. Also if you can construct a PDA, theoretically you can construct a CFG with it, but it will involve many more symbols than what most of the exercise problems require.
If you are writing a context-free grammar for a compiler of new language then it is understood that you know the tricks of the trade already. And sometimes the grammars of the new language are not even context-free.
First tip: Look for substrings in the language which are strings in some regular language. For regular languages you need to add rules of the form $A\rightarrow aB$ or $A \rightarrow Ba$ (or $A\rightarrow \alpha B$ or $A \rightarrow B\alpha$) whichever suits your intuition.
Second tip: Look for substrings in the language which need to balance some kind of count/symbols around strings of some other context free language. Then you have to add rules of the form $A\rightarrow aAb\ | \ B$ (or $A\rightarrow \alpha A\beta\ | \ B$).
With these two tips you will be able to construct grammars for many simpler context free language. For example
$S\rightarrow aa\ | \ \epsilon$ for context-free language (which is also regular) of even number of $a$'s.
$S\rightarrow aSb \ | \ \epsilon$ for context-free language of strings of the form $a^nb^n$. Here you need to balance a count.
Unfortunately, the language of balanced parenthesis, which is the variant of the language you are talking about needs a simple trick. Basically any production rule that requires two or more non-terminals is not very intuitive, in my humble opinion, unless the symbols are just placeholders (if there is some recursion involved, you will have difficult time in understanding the language accepted, see some grammars for context-sensitive languages, for example, they are truly difficult to understand if you do not have practice reading them). You have to get down to write a proof to see if the language generated by the grammar is indeed the same.
The language of balanced parenthesis is
$S\rightarrow (S) \ | \ SS \ |\ \epsilon$
$S\rightarrow (S)S\ | \ \epsilon$.
You can easily modify the grammar above to a grammar for language of strings with equal number of $a$'s and $b$'s. That can again be easily modified to another grammar for language of strings with number of $a$'s greater than number of $b$'s by 2. However, proofs that language of grammar is indeed the same as in question will involve some non-trivial logic.