I have a UPS and the problem is that my monitor's plug no longer fits in perfectly. It kind of slips and my monitor turns off and when I try to adjust it, it turns on but with little sparks from the UPS outlet. My question is can I insert toothpicks in the outlet along with the plug for better grip? Would that be safe because I don't want to replace the UPS.
That would not be safe. Absolutely DO NOT DO IT.
In fact, do not even try to stick anything else in the outlet besides the plug.
Now that said, how old is the UPS? Indeed... how old are the batteries in the UPS? Do you need the monitor on a UPS? I suspect if the outlet is frail, then the ups is YEARS old. I'd hypothesize it doesn't even work anymore.
So, go replace the UPS. If the unit has been serviced by you, and you have been replacing batteries, and you absolutely must use the outlet on it in question, replace the outlet. There is a chance you can service the outlet and expand the spring/blades but sincerely, I wouldn't bother.
Do not insert toothpicks into the outlet. The plug blades on the cord depend upon the friction contact with the metal contacts in the power outlet to make a good low resistance connection. If you insert toothpicks you may actually be making the connection worse which can lead to heat buildup in the outlet and possibly even letting it catch fire.
You should investigate if another power cord does fit well into the UPS outlet. If so you may be able to replace the monitor cord with another one. Most monitor power cords use standard plugs on each end and these are replacable. The sad fact exists that not all power cords are designed to the same dimensions in all aspects. Even the IEC type plug at the monitor can be so loose in some cases with certain cheap import cords that they literally fall out of the monitor jack with minimal pull.
If the outlet on the back of the UPS is truly worn out then there is the possibility to replace it. Many of the panel mount outlet components used are standard parts that you may be able to purchase at a place like Mouser.com. But if you do venture to open up a UPS to lookinto repair be very careful. Even unplugged from the wall there can be high voltage inside the UPS on capacitors or from the battery to AC conversion circuitry that can give you a severe shock or even electrocute you.
Absolutely do not stick things in the receptacle. It's broken anyway; that will not even solve the problem.
Replace the receptacle
Turn off and unplug, remove the battery, and disassemble the UPS (warning: it still has energized stuff inside, at low voltage unless it's on, then high voltage too! unless the battery is out.)
If this is the very familiar, common shape - you know the one - you can get a good one for $3 at the hardware store. (Avoid the 99 cent ones).
If it is an odder shape, then go hit your favorite electronics supplier, e.g. mouser.com, digikey.com, Galco, Halted, etc. and shop for a receptacle of the same dimensions and securement type. I've never had any trouble finding such things, fact is there are only a few styles.
Harper once shared this teardown and the image you really need to see is this
Note that the one on the left simply has a folded piece of metal. That's your "cheap" outlet. The one on the right has several more substantial pieces making the connection. So a toothpick won't actually fix the problem. Even if it weren't a fire hazard, it would eventually just drive that piece loose again.