Realtor?

Sa

We are wanting to put our house on the market and we’re considering doing for sale by owner. But if we want to hire a realtor, do you know if we have the pay the realtor if we put the house on the market but for some reason change our mind and decide not to sell? Like if a recession hits and theres no way we can sell our house for what we bought it.