Let's start by saying that I'm not an agent myself. I'm an international civil lawyer with 28 years of experience. 
And here's what I know for sure: every profession has its own boundaries of competence. And a clear understanding of what exactly I shouldn't do.
Selling or buying real estate, whether it's your first, second, or tenth, is always stressful. We all want to buy below market and sell above market. We want to avoid losing out on the price in both cases. Even if you were born in Eastern countries and haggling is ingrained in your DNA, it's no guarantee of success. You need to have at least a basic understanding of what you're bargaining for. Better yet, know for sure. See all the pros and cons. 
"I decided I'd quickly buy/sell everything myself." How many times have I heard this phrase? Usually after the fact. But if you go back to the beginning and read that I'm a lawyer, the question "why" disappears. 
My experience shows that this approach to life is more characteristic of residents of Eastern Europe and the former Soviet Union. In Western Europe and America, it's common to shift responsibility for buying and selling real estate to an agent. Firstly, this is enshrined in many laws, secondly, it's a social norm, and thirdly, it's psychologically more convenient.
If your car breaks down, find a good mechanic. If you have health problems, find a good doctor. If you want knowledge, find a good teacher. 
If you want to buy, pay for the selection. 
If you want to sell, pay for the client. 
Everything costs money – any job in any field.
I have extensive experience and knowledge in my professional field. I assess the legal purity of a transaction, contractual risks, and the legal consequences of signed documents, and I protect my client's interests from a legal perspective.
But I will not undertake to professionally determine the market value of an object, its liquidity, the prospects for price growth, the demand for a particular area, or the investment attractiveness of real estate - this is not my area of ​​expertise. 
Another point: as a buyer, I'm not prepared to call owners, find out whether they've sold or not, or adjust to the seller's schedule or their availability to fly to the country and show me a property that might not be right for me. With an agent, everything is much simpler: showings, properties, and owners are their responsibility. I simply save myself time and stress. And if I want to buy exactly what I want—according to my expectations, requirements, and budget—I always pay for the property selection. And I've never regretted it. 
This is all the work of specialists who are inside the market every day.
For many, I've answered the question in the title. All they need to do is make a little effort and spend some time analyzing, evaluating, and selecting the right agent. Pay attention to their length of service, reputation, honesty, and psychological compatibility. It's best to do this in person. Always sign contracts with clearly defined terms and conditions. Look for a good, professional agent—they definitely exist. At least, I personally know some. I wish you a successful sale or purchase.
Even if you have had a negative experience and believe that any agents in general, and real estate agents in particular, receive their commissions “for nothing,” the problem is not with the agents, but with people in general – in any profession there are plenty of both.
All decisions have a price and consequences. We'll all pay one way or another—either for the professional's work at the start or for dealing with the consequences of our decisions later. It's a matter of cost and the willingness to make mistakes.