For the past several months, Apple has been running a reduced cost battery replacement program in response to customer complaints but this ends on December 31, 2018. Thereafter, replacing any iPhone battery will cost you $49 for the iPhone 8 and older, $69 for the iPhone X, iPhone XS family, and iPhone XR instead of the current $29.
The reduced price covers the iPhone 6 and also newer models up to and including the iPhone X and iPhone 8 family. All you have to do is either take your phone to a Genius Bar appointment in an Apple Store or send it in to Apple for repair.
You can check the general state of your battery with a new option in Settings that was introduced as part of this process. Choose Battery, then Battery Health and you’ll see a very basic report. It just says what the maximum capacity of your battery is and whether it is capable of working at peak performance. If it isn’t, then you’ll see a warning message that recommends you get the battery replaced.
To get that done, start at Apple’s online support page and choose iPhone, then Battery & Charging and lastly Battery replacement.