The first picture shows a Buck Converter Module. It has the required external circuitry and facilities on-board so you can use with with minimum effort.
The second picture shows an integrated circuit (IC in short). As the name suggests, it integrates multiple stuff (e.g. sub-circuits, controller blocks, logic, etc) inside a tiny chip.
but then I also see much smaller and cheaper ones that look like this, which from reading their datasheets seem to require capacitors and all sorts in order to work:
What you have seen are quite possibly Buck Converter controller ICs or Buck Converter ICs. The key difference between them is the latter houses a switch as well whilst the former doesn't (you'll need to select/use a MOSFET or another semiconductor switch).
If you want to design a custom stuff, you can use ICs and design the external circuitry by following the guidelines given in the datasheets and/or the application notes. This is a bit of a hassle and requires some theoretical background because you'll end up with selection of a lot of components such as inductors, capacitors, resistors. Note that you can't use any type of inductors or capacitors in a buck converter or a switching converter, in general.
And yet others that have 3 pins, 4 pins, even 16 pins?
Generally, the more functionality and customisation the controller offers, the more pins it'll have. If you want to define a custom soft-start time or brown-out level or OVP level etc, there are many different ICs available in the market.
Which type should I use, and if one of the smaller more complicated ones are better, how do I actually get it to do what I want?
First you need to know your requirements i.e. output voltage (fixed or adjustable), maximum output current (continuous, pulsed, etc), input voltage range, ambient temperature range, etc. Then, you decide which direction to go:
- Design your own converter,
- Or buy a module and carry on
The latter is the easiest. Once you know your requirements, all you need to do is search the market (Digikey, Mouser, RS etc) and buy the module. You may also want to read the tutorials and reviews, if available, before buying a module.
Make sure the specs fit your requirements. As stated in another answer, if your maximum continuous current requirement is, say, 1 Amp then select a module that is able to deliver a higher level (e.g. 3 Amps).