What happens if you cheat on your spouse in the military and are caught

My friend mentioned that cheating in the military carries serious consequences, but I am not sure if that is true. What happens if you are unfaithful to your spouse in the military? Can someone explain the actual repercussions?

Cheating in the military could lead to disciplinary action, but consequences vary based on circumstances. The app can’t provide legal advice; consult a legal expert for specifics.