Your roommate wants you to come into the living room to look at a funny video he saw on YouTube. You're trying to work on writing a cover letter for a job application, and you want to finish it. You answer:
Hold on a sec; I'm in the middle of writing something!
The phrase "hold on" means "wait". You tell someone to "hold on" when you want them to wait for a short time. You use "hold on" instead of "wait" when the reason for the listener to wait is not that important. In an emergency situation, you would clearly yell "Wait!". But in normal conversation, "hold on" usually fits better.
In the example above, the speaker says "hold on a sec". This means "wait for a short time". "A sec" is short for "a second", but it actually means a short period of time.
You say that you are "in the middle of ___ing" when you're doing something and it's not convenient to stop. For example, if you're trying to write an e-mail for work that needs concentration, and someone interrupts you, you could say:
I was in the middle of writing an email when she walked in and started going on and on about some problem with they copier.
I can't look at that right now, dear. I'm in the middle of making dinner.
(Print this lesson)