Once you have signed the franchise agreement, there is very little possibility of breaking the contract. Most commonly, however, if you need to walk away from the business, you will need to find someone to buy it from you.
In order for this to happen, though, the franchisor will have to approve of the new franchisee taking over and you will need to be up to date with all your payments. You will also probably be required to pay a transfer fee.