Yes they work but only for anaglyph images or videos.
On youtube for example you can find different types of 3D movies and you can only use these red/cyan glasses for anaglyph 3D.
Generally for every 3D format you need the corresponding glasses.
1. Real 3D (One image per eye, either side by side or on top of each other)
1.a) Passive 3D glasses as known from the cinema theatres. These give the best viewing experience because the images for both eyes are constantly and simultaneously send to both eyes.
Some TVs also use passive glasses but it might not be the same type of glass. Also passive 3D TVs send a reduced resolution of the image per eye.
1.b) Active 3D glasses. 3D home projectors and some TVs send alternating images for the eyes. You might notice flickering
1.c) If the image is in side-by-side mode, you can use cross eyed technique to see a 3D image without any glasses. It is quite strange because your left eye will look at the image which your right eye is supposed to see and vice-versa. But somehow our brain can build a 3D image from it.
2. Anaglyph (The images for each eye are merged into one image)
Red/cyan, green/magenta or amber/blue glasses. The image/video has to be altered which results in colour loss but you don't need special equipment and can watch on a normal screen/TV.
Alternatives for glasses are Head mounted displays like Google cardboard, HTC Vive, Playstation VR or Oculus Rift which work without a TV (Cardboard and similar systems only need a smart phone, so they can be rather cheap).
You might also find rare smart phones or notebooks that use Autostereoscopy where you don't need glasses at all because the screen can direct the images to the eyes automatically.