Safe solar filters allow the Sun to be viewed directly, but you must be very, very sure that the filter you intend to use is safe. If you are not absolutely certain, do not use it. To be safe, a filter must reduce the amount of light reaching the eye by a factor of 100,000 or more (these are filters with an optical density of 5 or higher). A cheap alternative is welder's glass or number 14 or higher, but although useful for naked-eye observing, optically it is not generally very good.
Some telescopes are sold with a solar filter included. Treat these filters with extreme caution - many are not safe. My advice would be to throw them away and either always observe the Sun by projection, or invest in a proper filter from a reputable source. Make sure that any filter you use has been designed for the purpose you wish to use it. While there are some filters that are perfectly safe for naked-eye viewing, they would not be safe for use with magnification.
Filters that attach to the observer's end o a telescope (eyepiece) should be avoided as the Sun's rays are then focused on the filter, heating it to extreme levels and possibly causing it to shatter while in use. It is always best to use an objective lens filter - one that fits over the end of the telescope pointing at the Sun. An objective lens filter basically consists of a partially transparent mirror coating on glass or polyester. The mirror coating reflects most of the light and heat away, allowing a safe proportion of the Sun's light to enter the telescope. A reputable manufacturer of glass filters is Thousand Oaks Optical in California, USA. Type 2-Plus glass filters are acceptable for photographic and aided visual use, particularly with binoculars or telescopes. The Thousand Oaks Type 3-Plus filter should be used with extreme care for photographic use only. Polyester objective filters are usually coated with aluminum. These are less expensive than the glass equivalent. The trade name for this type of material is Mylar, but some material sold as Mylar is not of sufficiently good quality to filter the Sun's light properly. Always buy from a reputable dealer, and remember that the price reflects quality.
Other materials and filters that are sometimes claimed to be suitable for solar observation, but are not safe, include smoked glass, exposed photographic film, photographic polarizers and neutral density filters. In general, unless you are absolutely certain that the filter you have is safe, undamaged and from a reputable source, I would advise observing the Sun by projection only.