Samples are back in Helldivers 2; however, they are a bit different this time around. In Helldivers 2, Samples are a material you will need to upgrade your ship modules (you will need a lot of them). They can easily be identified as they resemble Pokeballs with a circular appearance with a line in between.
You will be able to collect these samples as loot from different sources, including enemies and containers. So, the best advice I can give you to farm currency Samples in Helldivers 2 is to explore the map properly, and you will find them naturally. This currency has different types in Helldivers 2, and you may have to adjust your difficulty and planet settings to find the one you are looking for.
Common Samples can be obtained up to medium difficulty, and if you want the better variants, you will have to increase difficulty. While the general advice to get Samples is to explore and play, some missions might net you more than others. So you should experiment a bit and see which missions suit you best (considering the time of the mission and the number of Samples each run) and then repeat them to get maximum samples in a given time.
Keep in mind that you can’t carry an unlimited number of Samples on each run, and the number is limited, so you will have to plan accordingly. Naturally, farming samples in Helldivers 2 will be better in a group than going solo. If you die or fail to complete the mission, you will lose the Samples you have collected, so you should also be careful about the objective you need to complete. If you die, your samples will drop. However, your teammates can collect them, so again, farming them in a group will be more effective.
The Failed to join or matchmaking issues seem to have been fixed so you should be able to join multiplayer (crossplay) without issues now and farm Samples easily to upgrade your ships.