A bottle of white spirits from your local hardware store can be quite useful.

Put a small amount on a white towel or nappy and just dab at the spot very carefully not rubbing to0 much as you will distort the carpet pile.

You may notice some transfer of the grease or tar onto your towel.

Keep putting small amounts of white spirits on clean sections of the nappy or towel and dabbing at the spots carefully.

Keep doing this until you have removed the grease or tar completely or at least removed to the best of your ability.