1. "Stop doing that". Fix your ergonomics, change your keyboard, and take breaks until the pain goes away.
2. A good physical therapist will help you root cause the problem and fix up major issues
3. Strength training, even just minor exercises for that wrist and arm. Eccentrics seem to be the one of the few things that really helps tendonitis.
4. Reduce stress. Somehow stress seems to exacerbate all of these problems.
I've also used the later model, MS Surface Ergonomic, and it's one of the worst keyboards I've had the displeasure to use. YMMV.
Get a sit/stand desk and vary your posture and shoulder/elbow angles over the course of the work day.
Exercise your hands, arms, and upper back. Lift weights, do indoor rock climbing, go for a swim, do some yoga.
Ignore your smartphone as much as possible.