This will be a quick one as there are not many differences. There are two things you will need to keep in mind. The version number DDR3 and DDR4 are the most recent. With those, they are both the same length but there is a notch in the middle of each version. But it will be in a slightly different spot depending on if you picked DDR3 or DDR4. Also DDR4 has a slight curve to the bottom on the stick, where as DDR3 looks like a rectangle. There are very few differences between DDR ram types.
Most computers built as of writing this will be using DDR4. With either tho, you will see a frequency and how many gigs it has. DDR4 will usually be faster than any DDR3 stick. Of course they are outliers. But generally a 4GB DDR3 stick will be slower than a 4GB stick on DDR4. For frequency, not all sticks are made equal. You could have a 4GB DDR4 stick at 2400 and a 4GB DDR4 stick at 2800. The 2800 will be faster, but will be the same amount of ram. But a 4GB DDR4 stick at 2400 and a 4GB DDR3 stick at 2800. The DDR4 stick with the same amount of ram, but clocked slower. Will still be faster than the DDR3 stick which is clocked lower. Mainly look at the frequency withing in the same group DDR4 to DDR4 and DDR3 to DDR3. To make things easier.