Datasheets are your friend
Before buying components, you should read the datasheet. A datasheet for an electronic component includes a wealth of information, such as:
- Physical dimensions for mounting and PCB layout
- Electrical requirements
- Details for proper usage
A datasheet can range from a single page to hundreds. For example, many modern Intel CPUs have 2-volume datasheets that total well over 100 pages.
Datasheets are normally in PDF format. (In the old days you would call the manufacturer and they would send you actual paper!) If it doesn't actually say "datasheet", check carefully - it may just be marketing material without the specific details you really need. Datasheets also change over time - a revised version might cover fixes to CPU flaws or improved tolerances or other changes.
Even if you think you know exactly what component you want to use, get the datasheet. There may be relatively subtle distinctions between components - e.g., voltage requirements or current usage - that can make one version of a component far superior to another for a particular application. For example, current usage may not matter much for a device running on mains power, but for a field sensor collecting data on battery/solar power 24/7, every milliwatt counts!
Datasheets are available in a variety of locations. The best sources are usually the manufacturer or a major distributor, but some are available through Wikipedia and other sources. Here are two examples:
Where to Purchase Components
Once you have figured out what components you want to use, you need to figure out where to get them. In the olden days, Radio Shack was the go-to place for hobbyists. But Radio Shack is mostly gone, and the universe of electronic components is far larger than it was 40 years ago. Your natural inclination may be to go to Amazon. But beware. Components purchased from Amazon can vary greatly in quality and may even be counterfeit. Be particularly wary of anything that says "Fulfilled by Amazon". That is a code phrase for "Someone else is importing this item and shipping it via Amazon, but Amazon is not really guaranteeing what is in the box". In addition, for small components, Prime-includes-shipping can bump up the price. You also may find a 50-cent item listed as $0.01 + $3.99 shipping, where if you bought it from a regular vendor it would really be a $0.50 "true cost". Buyer beware.
Most component manufacturers will not sell directly to small companies & hobbyists. A number of reputable distributors fill the gap. In addition to handling small orders, these distributors allow you to order items from multiple manufacturers at one time, provide access to datasheets and additional information, easily search through products (unlike Amazon where LED diodes get jumbled together with LED strip lights and LED headlights and incandescent bulb replacements) and find what you need. Some examples (as of 2020) are:
Keep in mind that not all distributors ship (at least at an acceptable price) to all locations and there are minimum order requirements and other constraints. But overall, a dedicated component distributor will provide more & better options than a general store such as Amazon.