Failing in front of your students can create a learning opportunity. If you announce before you demonstrate whatever it is that it might not work, students will perk up. This could be a science experiment, a mathematical proof, an online marketing technique in a business class - anything that can be tested in a relatively short time. When something goes wrong, challenge your students to figure out what it was and how to improve the process. Let them be the experts for once.