Your book, to be identifiable and to be "found" by buyers, librarians, bookstores, etc. needs an ISBN. The International Standard Book Number (ISBN) is a numeric commercial book identifier tha
An ISBN is assigned to each separate edition and variation (except reprintings) of a publication. For example, an e-book, a paperback, and a hardcover edition of the same book will each have a different ISBN. The ISBN is ten digits long if assigned before 2007, and thirteen digits long if assigned on or after 1 January 2007. The method of assigning an ISBN is nation-specific and varies between countries, often depending on how large the publishing industry is within a country.
Usually, your publisher gets your ISBN. If self-publishing, you buy your own from Bowker. Just one costs 125.00. Ten cost $295.00, and 100 cost $575.00. Most likely you should buy at least ten for multiple versions of your book. You can easily see that what country your book is distributed in may require unique ISBNs.
That is unless you use Amazon/KDP or another hybrid company for self-publishers. KDP will offer to "give" you an ISBN OR you can use your own. Other hybrid companies may do likewise. In the old days if Amazon gave you an ISBN, they were the imprint (publisher), but no longer. You are the publisher, the book is in your name, and you retain all rights. With Amazon's (or others) Expanded Distribution, your book is listed or findable on Amazon.com or their platforms in multiple countries, probably the U.S. and U.K. being the biggest markets.
Amazon/KDP assigns every book or ebook its own number called an ASIN regardless if you have an ISBN or not. Another thing too about KDP, they don't require or assign an ISBN to ebooks, so if you want an ISBN for your KDP ebook you must own one. Because I own a block of ISBNs, I assign one to every book or ebook I publish, again, for the purpose of easy identification, especially in markets other than Amazon/KDP.
It's very important to list your ISBN on the Important Notices page of your book, along with your copyright and other info. So make sure you add the ISBN there before uploading your manuscript to a self-publishing service like KDP. A Library of Congress LCCN number is also good to have there. It's free, but you need the ISBN number to get it. Librarians use the LCCN to find books.
If an author I'm working with needs an ISBN I provide one for $60.00. I also get the LCCN for authors I work with.
A word about Barcodes: A barcode is on every back cover of every paper print book or hardcover book jacket. It has metadata and the book's price. A barcode from Bowker may cost $25-30. Again, the publisher gets it. If you use KDP et al. they get it/make it. So unless you are creating your own front/spine/back cover, you usually don't need to worry about the barcode. Retailers use/scan the barcode when they sell the book.
The above info is general, specifics may vary, but it fits most cases.