Most contracts will have "out" clauses, for things like financing, appraisal, inspections etc. They usually part of a "due diligence" period that allows you to research the property and make a fully informed decision.
Without reviewing your contract, I cant begin to tell you which "out" clause you may take advantage of to get out of your deal, but your agent should be able to advise you.
Why do you want out? If it's buyer's remorse after making a huge decision, this is understandable, but please take a deep breath and reconsider your decision to back out. You may have a few days to do this before losing your standing with the seller. Backing out now and then begging to get back in later may not be possible or if it is come with a serious financial consequence.
Best of luck, let us know how things go.