How do you text a local switzerland number from your us phone while in switzerland?
Since you're call goes through on the local Swiss network you just have to do it the same way a local Swiss would. It will be a "0", followed by a (usually) two digit area code that indicates either the city or wireless network, followed by the 7-digit local number. Whoever you are trying to call will be able to tell you what number to call - just put it into your contacts list and call or text!
If you have a phone from country A and you are in country B, and you dial a number without an international prefix, it usually goes to the corresponding number in the country are in. It is therefore safer and recommended to store all numbers in your phone's memory with the country prefix, for example +41..... for Switzerland, +33...... for France etc.
That way you are sure you will get the correct number. Otherwise you could forget when you cross the border and end up with the wrong number. It never costs more to dial the full international number.
Radio waves do not stop at borders, there are some border areas which can only get a 'foreign' mobile phone signal, which is another good reason to always add the country code prefix.
If you have an international plan or are using a Swiss sim-card in your phone you will just need to dial the number normally. Your international plan should put you on a local phone service provider. If you aren't on an international plan then you may have to dial like you were in the USA but this option can be very expensive since your US provider will charge you a very expensive roaming fee. Even if you just plan to make a couple calls it can be worth it to set up an international plan before you leave, this can also sometimes give you some data usage if using a smartphone. You can find more information here.