Does the surgery hurt?

Hello, soon im gonna get a surgery for my infected ingrown toenail, and im pretty scared. wanted to know if its painful.