I feel so bad

My daughter kept crying & I felt myself getting really irritated because I knew nothing was wrong with her so I sat her in her bassinet & I went to sit on my bed & calm down. When I went back to check on her she scratched her face up really bad I guess from crying & being frustrated. I know it’s hard for babies because they can’t say what’s wrong or what they want but what am I to do in situations where I just need some time to myself because I feel overwhelmed