You apply on line if you are holding a DPS card or medical card otherwise the application must be made by writing.
Be aware that for some countries (like France for eg) you still have to pay for a visit to the doctor and applied afterwards for a partial refund. Mind you, the doctor fees are much cheaper in France than in Ireland, I paid EUR 22 for the doctor visit (ear infection) for my son last november, I sent all the paperwork to the Securité Sociale as requested but to date no trace of the refund, they did receive the application and told me the amount I will be refund but no trace of the money yet.