I don't know how the things work here and how can I find a good(also affordable) mechanic near me?
The best way to find a "good" mechanic is word of mouth. Ask your friends/relatives/work associates/etc. Everyone has a mechanic. Do NOT limit yourself to a dealership. It's probably the most expensive way to get your vehicle fixed.
I also don't know should I buy the part before going there?
Most places don't like you to buy the parts before going there. There's several reasons for this, but mainly because they can't mark the price up on you.
There are other reasons you may not want to purchase your own part, mainly having to do with you picking the right parts to buy. Unless you are really comfortable in knowing exactly what you need, leave it to the experts. I suspect since you are asking the question, you aren't completely knowledgeable in finding the parts in the first place or where to find the best deals on those parts. Realistically, this is just one of those things you'll have to put up with paying for to get someone else's expertise.
Another reason to let them get the parts for you is, they will most likely provide a warranty on the part as well as the labor involved if something goes wrong with that part. If you bring it in yourself, you won't get either of those things, except from wherever you're getting the parts from.
How much should I pay to a mechanic to inspect my car and find the parts I must change?
Any shop worth their salt (at least here in the States) is going to charge by the book hour. They'll have the rate posted. If you take a vehicle in to only have the problem diagnosed, you can expect they will charge you an hour or less of book rate charges for diagnostics. The only time I'd suggest it may be different is for electrical issues, because they can be truly difficult to diagnose.
If the shop doesn't show their book rates or don't have an idea how many book hours they are going to charge, pass on that shop and go someplace else. Also, if you take it there to get work done, most places will include diagnostics as part of the repair process. Again, the only exception I can think of here is if it's electrical.
Should get an appointment before going there?
That depends on the shop, but most places I've had experience with you can just drive in. Some places will deal with appointments, but more than likely they are going to expect you to leave it to get fixed. There may be other things going on where you live with regards to any COVID stuff or what have you. If you have any questions about it, just call them. They should be more than willing to tell you what their procedures are.