How to apply a mel-filterbank to a signal?
Binning is an averaging operation on the (squared) magnitudes of the DFT. You would maybe have $256$ DFT bins but only around $20$ outputs of the filter bank. So you need to average groups of DFT bins to reduce the dimension from $256$ to $20$. For a mel-scaled filter bank, the averaging functions (kernels) are usually triangular, i.e. the center DFT bins get more weight than the rest. As an example, let the first kernel that is used for averaging the lowest DFT frequencies be stored in an array $W_1[k]$, $k=0,\ldots,K-1$, then the output of that filter bank channel is computed as

$$y_1=\sum_{k=0}^{K-1}W_1[k]R[k]\tag{1}$$

where $R[k]$ are the (squared) DFT magnitudes. In this way you compute all $20$ filter bank outputs. You just need to know (define) the weights $W_i[k]$ and the range of DFT indices that are averaged by the respective kernel.

This answer to a related question might also be helpful (also have a look at the comments).