“I nicked it shaving.”
Your ear has a cut on it. It happened when you were shaving this morning. Your daughter asks what happened, so this is your answer.
I nicked it shaving.
To "nick" something means to accidentally cut it a little bit.
For example, people "nick" themselves when they're shaving.
You might "nick" your finger while cutting vegetables in the kitchen.
A "nick" is smaller than a cut:
Don't worry. It's just a nick.
Talk about an accident that happened while a person was doing something:
I ripped the page trying to pull it out of the folder.
This means "I ripped the page while I was trying to pull it out of the folder."
She tripped going up the stairs.
This means that she tripped while she was going up the stairs.
The two things should be very closely connected. If two things happened at the same time, but they're not connected, you should use a different structure like this:
I dropped my phone in the airport when I was walking to my gate.