Speaking from the perspective of a graphics/audio/video guy here, XCNuse has got some of it confused (no offense)
Lossy/Lossless is more related to the way you save/export the file. Usually for images, common file types are jpg, gif, or png. These are usually all lossy formats because when you save them, whatever program you’re using uses a compression algorithm to get rid of information you can lose for the sake of a smaller file size. For jpg, for example, most programs get rid of redundant color information. (So if 2 pixels are next to each other, and are the same color, jpg will get rid of the color information for one of those pixels and just borrow the information already saved for the pixel next to it and reapply it)
Music is similar. Mp3 is a Lossy format because it is compressed when saved/exported.
Something lossless doesn’t compress at all. But it can be tricky because the file extensions might actually be the same as lossy files. For example, when saving a photo as a tiff, you can choose to compress it (making it lossy) or you can choose to leave it uncompressed (making it lossless)
Having a good understanding of lossless vs. lossy has more to do with the programs you’re using to create these files and not as much with the file extensions.