Switzerland is a permanently neutral country, which means that is remains neutral in every conflict. It has been so since the 16th century (Switzerland used to be active in European wars until 1515).
In both world wars, Switzerland remained officially neutral. That does not mean that the country made no mistake or never did anything wrong, but it means that the country did not join any alliance.
Swiss neutrality is an armed neutrality, which means that the country has an army in order to defend itself if it is attacked or if its territory is violated.
The country if officially neutral, but of course its citizens may have their own opinion or preference during a war. During WW1, the German-speaking Swiss citizens tended to approve Germany, and some Swiss officers or politicians had contacts with German officials. Some of them have even been accused of treason. On the other side, the French-speaking part of Switzerland was largely hostile to Germany and some of the French-speaking citizens wished for an Allied victory.
This led to internal problems between the German-speaking part and the French-speaking part of Switzerland.