Congrats on the catch! Others have covered things quite well (max fishing level including food buffs, trap bobber unless you want to go for a perfect catch and cork bobber if so, etc). I just want to add a couple of things.
First, nowadays there's the Advanced Iridium Rod. If you're having a hard time, what's better than the trap bobber or the cork bobber? Both! Or two of either, for super slow escape or crazy large fishing bars :-) Nothing requires you to catch them before you have access to this, so if it's causing you trouble just wait until fishing mastery and try then.
Second, as far as the strategy for the fishing minigame itself, I just want to point out a few tips that helped me when I was going for perfect catches on the legendary fish:
1) They're more likely to "dash" towards the midpoint, going up quite quick on the bottom or down quick from the top. So when hovering your bar over them, have more than half the bar in that direction, it gives you more reaction time to keep them on the bar.
2) Don't fall for their bait movements, they're prone to juke like they're going to dash across the bar before returning to exactly where they're at. Following tip 1 helps with this as it means you have more wiggle room but ultimately you need to learn to spot the fake-out and not over commit when they make those moves.
3) Similarly, watch for them making a big movement towards the other half of the bar then immediately returning from whence they came. If they're going to do it, it'll be right when they move, so just be ready for it; chasing that sort of movement improperly is one of the easiest ways to lose a *lot* of your bar and it's really just a matter of practicing following them when they go, or alternately (especially if using the trap bobber) just give them a beat to make sure they're not dashing back before following them across big movements.
4) It's virtually guaranteed they'll lead with a big movement up, so when fishing for them in general just be ready with your finger on the trigger to leap up with them the moment the minigame starts. With practice you'll get the hang of where they tend to go to, and the same principles from above apply - good chance they'll dash back down right after so best to leave more bar in that direction than above, etc.
5) Finally nothing is a substitute for practice. I would fish for the legendary fish all day then quit out before the day was done, start it over again, and just practice over and over until I got the hang of them. I see no dishonor in restarting the day to practice as much as you need to, though don't burn yourself out on it of course.
Clearly not needed for you OP, but if anyone else strugglebusses with them here's hoping this helps!