To malfunction is to fail to work properly. If your toaster spits out a charred, smoky mess no matter what setting it’s on, your toaster is definitely malfunctioning.
When something functions, it works. Adding the prefix -mal (meaning "bad") to function indicates bad or unsuccessful functioning. When a computer malfunctions, you could lose your data. A malfunctioning car could cause an accident or leave you stranded. This word is typically used in reference to technology, tools, and gadgets. However, if you make a stupid mistake, you might joke that your brain has malfunctioned.