If the hematoma happened during sex
, it was probably just a minor blood vessel that broke or leaked.
This would imply that the hematoma is not that large (< 1"), but may look awful--purple, black, green & yellow. It will heal all by itself over a couple of weeks. If you apply hot compresses, it will heal even faster. There is nothing else to do. This is just a freak occurrence.