I pinched my thumb and I have a bruise under my thumbnail-how can I get rid of the ugly black and blue bruise?

Good News I think. Generally, unless there was signficant damage to the nail-bed, the bruising you see, should gradually go away, but it is a very slow process for the old blood to get broken down by the body's defenses. If the problem is persistent, go see your doctor. The good news is that, in most cases, such injuries do heal without medical intervention.
Red hot paper clip. Bend paper clip, heat end till red hot and carefully punctur nail over center of blue/black area. Tiny hole will vent the bruise and permit blood to escape. Hot end of paper clip will immediately be cooled by the blood. Just go through the nail and not into nail bed. Sound drastic but is effective, especially if done soon after the injury. Otherwise tincture of time will eventually heal.
Time. The black and blue bruise under the nail has to grow out. Give it time.