Autoimmune diseases are when your body's own immune system attacks its own body because it perceives your own healthy body cells to be dangerous.
To first understand how autoimmune diseases work, you have to understand how the immune system works. When a foreign pathogen enters the body and starts destroying body cells and replicating, the immune system creates antibodies to tag and identify the pathogen cells for destruction by white blood cells. The antibodies are then stored for later use. The antibodies are unique to that certain pathogen so if you so happen to encounter the pathogen again after you recovered, the body's immune system will be able to fight off it much more quickly than the first time since it already has the antibodies from last time.
In autoimmune diseases, the immune system produce that antibodies that tag healthy body cells which are then attacked by the white blood cells. The cause of this is not known but it can be contributed to environmental factor or other diseases or bacteria.
A well-known autoimmune disease is Type 1 diabetes. That is when the body destroys its own insulin, which is used to break down glucose. Although there is no cure for this, people can survive by taking in insulin from another source like an injection.