Not a computer person, so I'm not sure if it's the modem or router (the machine for my wifi that has the lights on it to show if it's working)- is there a way that can overheat and cause some kind of burning smell? I can understand if it's new and possibly just made incorrectly and faulty, but I've had this, I think, a few years. Just a couple nights ago, I smelled something sort of burning and went around my apartment not being able to pinpoint something and figured maybe something of the neighbors. Then I touched the cord on that machine (the white cord that connects to the wall, not the plug with prongs, if that makes sense. You twist this in place, not the rehular kind of plug.) When I touched that to reboot the machine, it was burning hot, and the machine was a bit warmer than usual. I thought I smelled something odd from the machine, but I can't be too sure that's the source.
First, some technical terms! A modem is a term for an old dial-up modem. Now, it's used as a term meaning what connects your cable box to the internet. Your cable box would have your provider on it usually. (comcast, xfinity, at&t, fios, etc.) The cable box also usually includes AP hardware. AP stands for access point, the thing that your devices connect to over wifi. A router is now considered something that is just an AP. Sometimes, people install routers for faster wifi, or for security, or a huge amount of other reasons. Try taking out your router, plugging it in in another room, and see if it really heats up. My guess is that you're in a 220volt (everywhere pretty much in europe) area. That would make the transformer (turns the 220 volts AC down to 12volts DC) much warmer. If the router is rated for 220 volt (see if it says input: 110-240 volt on the packaging or device itself), then get a replacement. Otherwise, just buy another one.