“Whether you think you can or you think you can’t, you’re right” is credited to Henry Ford. The earliest Ford attribution found by Quote Investigator is in Reader’s Digest in September 1947: “Whether you believe you can do a thing or not, you are right.” Ford had died that April, and the magazine gave no source.
The idea is much older. Virgil wrote “Possunt quia posse videntur,” which John Dryden translated as “For they can conquer who believe they can.” In 1905 John Herbert Phillips combined both halves of the saying in a speech to high school students in Alabama.