You most likely have an inflamed epidermoid cyst or an abscess
on your thigh.
The epidermoid cyst needs to be surgically removed including the capsule or it will grow back. An abscess needs to be drained and you need to be placed on antibiotics. See you local dermatologist for treatment.