I wonder if it is possible to generate electric energy from the radiation of radioactive materials like nuclear waste? If it is then wouldn't that also mean that it could be used as an energy source for a very long time since the radiation takes a long time to decay?
There, in fact, is such a way to convert heat produced from radioactive decay into electrical energy. Many systems doing just this have already been designed and used. The most straightforward device is a Radioisotope Thermoelectric Generator, which does exactly what you are asking. However, in principle, almost any system could be implemented that uses waste heat from radioactive decay to generate electricity. Stirling engines and thermocouples are frequently implemented to convert the heat to electricity.
These devices are typically used when long-term power is needed and connection to a power generation facility is not an option. Spacecraft being a key example. The only notable problem is that as the material decays, the power generation decreases. For sufficiently long-lived isotopes this is not a significant problem.