How to use a CFG to restrict a subset of a*b*c*d* so that there are at most as many a's and b's as d's?
There are lots of answers on this site about this subject. See, for example here and here. The underlying idea that often works for problems like this is to work from the inside out.


The $c^k$ part is easy: just use the production $V\rightarrow cV\mid c$.
The part surrounding the $c^k$ part consists of a bunch of $b$s followed by an equal number of $d$s. That's also easy; it can be generated by $U\rightarrow bUd$. Once we're finished with that, we switch to the $c$ part, so we have $U\rightarrow bUd\mid V$.
Keep going. Now you want to surround that part with a bunch of $a$s followed by the same number of $d$s. With what we've done so far, you should be able to do this part.
Finally, we want $i+j\le h$ so we concatenate the strings we've generated so far with zero or more extra $d$s. See hint (1).


As with many subjects, it gets easier the more examples you've done. Just keep at it.