I have a coach so I just listened to what he said. Ha!
Really, just stick with it. A coach early can help a lot with form and efficiency as well as drills. Master classes are also good if that's an option. If no coach, find an online training program that builds up to where you want to be and stick with it. I swim 3x a week, some swims are a mix of drills and long, some swims are a mix of sprints and long, some are just long. Don't be afraid to take breaks but don't rest too long, if that makes sense.
I started swimming about a year and a half ago and thought I was going to die at 50m. I'm swimming 4,500 straight now....
ETA: I was using tri newbies for my training program before my coach. Haven't revisited it and only made it a couple weeks through it so no real comments on how good it is