In brief, open source means that the software can be used and shared freely with the source code and without any restrictions, and derivative works may be distributed. This freedom does not mean that there can be no legal problems with using open source.
Because open source software is also subject to licencing terms and unfortunately there are a great variety of different open source licences, some of which contradict each other. To determine whether an unknown software licence can be considered an open source licence, we first recommend looking at the Open Source Initiative website. There you will find an extensive list of certified licences. The mere use of software listed there as open source should not raise any legal problems.
The assessment is more complex if the open source software is to be amended and distributed. In general, the derivative work is under the same licence as the original. However, this leads to complications when the developed software contains open source software with various licences that contradict each other. In this case it must be checked in detail for whether and how legally clean distribution is at all possible.