This depends entirely on what you're comfortable with. A professional editor can be a great idea if you find the right one, but that involves a lot of research and, of course, you need to have a budget in place for that. A quality editor will, at minimum, run you several hundred dollars, and that's just for a developmental/structural edit, which only looks at your story itself to help you with pacing/character/structural problems, and makes no attempt to actually edit the prose itself, or fix typos. For that kind of full-blooded edit/copy edit, that will run you even more if you don't have the confidence to do it yourself. Some writers will do this to give their book the best possible chance in the hands of a literary agent, other writers will do this because they're self-publishing, have the money on hand, and want to make sure their writing is as professional as possible before hitting the market.
But once you've gotten the beta reader comments back, I'd say read them, then sit on them and decide which ones really improve the book for the better. All of this is going to be pure opinion, so not all the beta comments are going to resonate with you. However, if you find that, say, you had 10 beta readers and 7 of them are pointing out a thing and saying it's problematic, you should definitely pay closer attention to that. If everyone's opinions are all over the place about different things, that's just individual taste at work. If lots of them are consistently getting hung up on something, that's a red flag to you that you've probably got something to fix.
Once you've made the changes, you should try to polish your book as much as possible. You absolutely don't have to pay for a copy or line-by-line edit at this stage, but try on your own to fix as many typos and grammar errors as you can spot. Grammar checker add-ons like Grammarly can help in this regard if you're willing to use the trial, or even just subscribe for a month, long enough to get the job done. When that's all finished, make sure your book adheres to all the standard manuscript submission format conventions, like being double-spaced, 12 point in a font like Times Roman or Courier, all that good stuff. Then take a good long time to work up a good query letter, which, to me personally, I found harder to do than writing the damn book. When you've got a query letter, start looking up the agents that represent your genre, compile your list, or just use some service like QueryTracker to help, and then... welcome to the Query Trenches. You're now slogging it out with thousands of other people trying to get the attention of a literary agent who will, if you're lucky, offer representation, then be your advocate, getting editors to look at your book and trying to convince those editors to give you a deal.
That's the conventional way to do it. Although the agent hunt these days has a lot of different options, like Twitter pitches directly to agents, going to SFF conventions and pitching to agents in person, or even new activities like "Pitch Wars" where hopeful new writers enter a contest to have their novel considered by established writers who then act as mentors, polishing up the novels, and then bringing them to literary agents to consider. There are a lot of ways to go about these days.