How to mute your iPhone if the physical silent switch is broken or not working

Learn how to put your iPhone in mute, silent, or vibrate mode even if the physical ring/silent switch has failed and is not working.