It is no guarantee that the home will sell for the amount the realtor comes up with, but it is the best tool for determining what your home should sell in the current market. It's best to use a local realtor for this because they should know the local market and what neighborhoods are comparable.
I would never trust a price from a realtor who simply looks at your home and tells you the price without doing a comparative market analysis in writing. I also wouldn't trust any online automatically generated values as these are generated by computer modeling that doesn't have the complete information about your house or local market.
This will also help when it comes to selling your home because you can pick the right price and won't waste time marketing the home too high, or give away your home at too low a price. You also have to consider the buyer of your home will likely have to get a mortgage and will have to have the house appraised in a similar manner. If you sell the home at too high a price the home likely will not appraise at or above the sale price and the bank won't give the buyer the loan.