Instructions
Prepare for the battle by purchasing any healing items for your Pokemon. Gyarados is certainly not the toughest boss in the game, but he is still quite powerful and capable of knocking your team out if you go in unprepared. Save your game before the battle in case you do get knocked out so that you can start over right before the fight without having to backtrack unnecessarily.
Take advantage of Gyarados' weaknesses. Gyarados have been weak against Electric-type Pokemon since the first generation of games, so send in any of this type of Pokemon you have. Avoid sending any Ground-type Pokemon -- Gyarados is both Water- and Flying-type, so it is immune to Ground attacks. Otherwise, send in your most powerful Pokemon of any type to bring Gyarados down.
Attack Gyarados relentlessly with your most powerful Electric attacks -- these vary from Pokemon to Pokemon and depend on your creature's level, so use what you have in your arsenal. If you have any Pokemon that can produce harmful status effects, such as Poison, use them to help whittle Gyarados' HP as the battle continues. Gyarados has more than 500 HP, so attack continuously while keeping your Pokemon's HP up with healing items.