Some cartridges (especially for revolvers) are designed in a family, with a number of cartridges of different power levels in very similar cases, and with very similar bullets.
The general advice is to only use the ammunition for a gun that it's specifically designed for - and to confirm any markings on the gun with both the box marking for the ammunition and the headstamp on the ammunition base.
Some identical cartridges go by a number of different names. For example, ".380ACP", "9mm Kurz", "9mm Corto", "9mm Short", and "9x17mm" all refer to the same cartridge. The "9mm Luger", "Parabellum", "9x19mm" are the same cartridge. The "9x18mm" or "9mm Makarov" is a completely different cartridge used by the Eastern Block in Europe.
Those are cartridges for semi-auto guns, and the way they are designed the exact cartridge must be used for the handgun they fit in. When loaded into the barrel's chamber, these cartridges all rest on the mouth of the case. The barrel and rifling is precision designed for the circumference of the bullet loaded in the cartridge.
The design of revolver cartridges is a bit different. These cartridges rest in the cylinder's chambers on the rear rim of the cartridge, which is actually wider than the body of the cartridge case. For that reason, a revolver can be designed to work with cartridges of different lengths, and that is the case of the .38 special and the .357 magnum. The main difference between the cartridges is that the case of the .357 is a bit longer, there is more powder in it, the primer that ignites the powder is more active and the bullets are often a bit lighter.
Your S&W 686 revolver is designed to withstand the pressures generated by the powerful .357 magnum ammunition, as well as the less powerful .38 special ammunition. This is why it works with both cartridges.
A standards body in the USA, and another in Europe have specified the details of what each of these cartridges is. It's called SAAMI in the USA, and CIP in Europe.
The SAAMI specifications for pistol cartridges is here, if you are interested in a reference:
SAAMI Standards – SAAMI
Buy a box of each kind of cartridge when you can, and try them both. The .357 magnum will generate more recoil so you have to be prepared to manage it and follow through properly after the shot.
Consider an NRA Basic Pistol class. You'll find it interesting, improve your safety with handling a gun and enjoy the coaching that many of the instructors share...
Welcome to the forum.