Concerning the "solid" garbage, when you send lines the following happens.
1) If there are "pending lines" (the stuff in red on the right), then this number of lines is reduced by the number of lines sent.
2) If there are garbage lines on your side, then the number of garbage lines is reduced by the number of lines that could still be sent.
3) If there are still lines that you haven't sent yet, then these lines are sent to the opponent.
Garbage with holes is a little bit different, as sending lines doesn't remove your own garbage: you have to clear it by yourself, which is way more fun as it involves some more strategy.