If Tony Stark could have gotten the Arc Reactor removed safely (as evidenced in Iron Man 3), then why didn't he get that done in Iron Man 2 when it was killing him?
Copied from my answer over on Movies.SE for a similar question:
During the scene where Tony has the surgery, you can see a miniature ARC reactor and some gadgets above Tony. As the surgeon removes a piece of shrapnel, he releases it and it flies up to the gadget. So Tony and the surgeon built an electromagnetic device to help out with the surgery. The eagle-eyed will also notice that when they show Pepper and Rhodey watching the surgery, the signs on the doors in front of them are in Chinese. Shortly afterwards, Tony gives Pepper a necklace, and behind them is Shanghai's skyline. He went to China for his surgery.
During the credits, you'll see there were several movie studios involved in making the film. Marvel Studios and Paramount are familiar names to people who watch Hollywood films. DMG Entertainment was another one, which may be more familiar to fans of Chinese cinema. They're a Chinese company that in recent years has been investing in Hollywood movies. They do this, and Hollywood movie studios agree to this, because by working with a Chinese company, the film then isn't treated like a foreign film. There are limits on the number of foreign films that can be released each year in China, this sidesteps that. In return though, DMG has extra China-centric scenes filmed that are then included in a China-only cut of the film (this happened for both Looper and Iron Man 3).
For Iron Man 3, the China-only scenes explain why Tony went to China for his surgery. At the start of the film, in Switzerland, Tony briefly meets Ho Yinsen and Dr. Wu, a cardiologist. Dr. Wu is the one who performs his surgery. In the non-China cut of the film, this isn't really explained. During the China-only scenes, it's stated that Dr. Wu is the only one who can remove the shrapnel from Tony's chest. So Tony goes to China and gets the shrapnel removed, which is something he couldn't do before.