More information is needed. What medication, etc.
Hello and hope you are doing well.
If you have constant coughing it could cause muscle strain and chest pain. Sometimes the pleura, the lining of the chest cavity and lungs can get inflamed causing pain with coughing. . I would suggest you consult a primary care physician for proper evaluation. In the meantime you can take OTC pain medication Ibuprofen. Ensure to take this medication after food to avoid gastritis.
Hope this helped and do keep us posted.