There's no foolproof way to know for sure, but there are a few things you can watch out for. For example, if an agent is pushing you to buy a property that isn't in your budget or trying to get you to sign a contract before you've had a chance to look at other properties, that's probably not someone who has your best interests at heart.
You should also ask the agent how they plan to help you find the right property. If they're just going to show you a few houses and then send you on your way, they're probably not interested in helping you find the right home - they're just interested in making a sale.
It can be tough to know if the real estate agent you're working with is looking out for your best interests, but there are a few things you can watch out for.
Ask what their fee is. A good agent will work on commission, meaning they only make money if they sell your home. If the agent you're talking to is asking for a flat fee or wants you to sign a contract that locks you in for a certain period of time, it's worth considering whether they have your best interests at heart.