hi and thanks for the query,
1) impacted wax leading to pain.
2) injury to the ear canal
with buds leading to pain.
take a pain killer like tylenol or ibuprofen
you have to meet an ENT specialist
to know the cause for earache and to clear the wax.
do not try to clean wax with buds.
buds are not meant for cleaning inside the ear and frequently lead wax impaction