Open-source licenses are not all the same.
MIT = use it almost however you want, just keep the license notice.
Apache 2.0 = similar to MIT, but adds stronger patent protection.
GPL / copyleft = you can use and modify it, but if you distribute your version, you may need to release your code under the same license.
Permissive licenses let code spread easily.
Copyleft licenses try to keep improvements open.
Before using code in a product, check the license.