It's a military court convened by the branches of the armed forces to try cases involving violation of military law, discipline, and regulations.
A court-martial is a military court. This a whole judicial system to bring service members to trial in a military way.
The officer must have done something very bad, he is then tried and his medals and badges are confiscated and he is punished.
There are several courts to which an appeal may be made, depending on the circumstances. The following site contains a discussion:
A military courts martial is a legal proceding that is conducted under the rules and regulations of the military. There is a judge, jury and attorneys involved. In some cases these are very informal,...