You can only deduct out of pocket expenses for a recognized charity so if you donated to a hospital you can deduct those costs. If audited you would have to produce some documentation of your donation. Deduct as a charitable donation if you itemize.
The only potential deduction associated with the donations would be as charitable contributions. However, those would have to be made to a tax exempt organization and even then, you could only deduct the cost of the materials you used to make the masks, not the value of them taking into consideration the time you spent to make them.
**Mark the post that answers your question by clicking on "Mark as Best Answer"
You can deduct donations to a registered charitable organization. A nonprofit hospital is probably a registered exempt organization, but for-profit hospitals are not. You cannot deduct donations or gifts made to individual people, even if they are deserving. The donation must be to a registered organization. You can deduct the cost of the materials but you cannot deduct anything for the value of your time.
if audited, the IRS will require you to approve the cost of the materials, and to show some kind of acknowledgment from the organization that you made the donation, such as a letter.