Examine the parts on your TV tray that you want to replace. For instance, if it's a screw or a nail, then how big is it, what is it made of, and how was it used as a fastener? If you're looking at a bigger part, such as the tray top, then determine the dimensions, how its connected to the rest of the tray, and what's wrong with it.
Take your part that needs replacing to a local hardware store. TV trays are simple things, and if you have the part that needs to be replaced, then bring it with you and ask an employee if they have something similar. You may be able to find the exact product, or you may find something slightly different that will work just as well.
Replace the old or broken part with the new part that you found. Once the part has been replaced, your TV tray should be in working order again, but try it out just to be sure.