It depends what outputs you have on the computer, and what inputs you have on the TV.
If you have a VGA output on the compter only, then you will have to have a VGA input on the TV.
There is no economical way to convert the analog VGA signal to digital DVI or HDMI – there are encoder boxes but they will cost $60 + and they will not improve the quality over VGA. You would be better off buying a new video card for the desktop machine (not an option for laptops).
If the computer has a DVI or HDMI output, you can go to a DVI or HDMI input on the monitor with the appropriate cable. You can also convert from DVI to HDMI with a DVI-HDMI cable because the digital video signal is the same between the two interfaces.
Keep in mind that unless it is a good quality TV, the screen view may be lower resolution and lower quality than you would expect.
Also, VGA and DVI do not handle audio, so you will not get sound on the HDMI input on the TV if you go DVI to HDMI or if you run VGA direct. You will have to run sound separately though analog audio cables or a digital audio cable to a receiver. Typically, you would use a Y cable to go from the 3.5mm stereo headphone output of the computer to two RCA inputs (right and left) on the TV, powered speakers, or a stereo receiver. If you have HDMI output on the computer, double check that your video card supports sound on HDMI.
If you have a Macintosh, you may have a Mini-DVI or a Mini-DisplayPort or a Thunderbolt video output, depending on your model. There are adapters that will go from each of these to DVI or HDMI.
There are several other possible analog inputs for TVs, none of which are good for computer monitor use because their quality will be too low.
If you have to, there are adapters that will bring out a component or composite signal from a computer’s VGA output, and there are encoding boxes that will generate S-Video or Composite analog signals from an HDMI digital input, but these can get pricey.
Component YPbPr video – three RCA jacks, usually red, green and blue
S-Video– a round multi-pin connector – better quality than Composite, not as good as Component
Composite video – one RCA jack, usually yellow. The poorest quality video signal.
RF input – a “cable” screw connector. This isn’t a video signal at all, this is a television cable or broadcast signal. To use this jack, the TV has to have a tuner, and the source signal must be modulated into a TV signal on channel 2 or 3. This is seldom if ever a workable solution.