A line guide is more difficult to replace than the tip. Guides are either single or double footed. They are put on by wrapping thread around them then coating it with epoxy. If one came off it probably broke the threads or slipped out from under them if it is a single footed guide.
You can buy a rod guide at most sporting good stores. Be sure to get one the right size for the one you are replacing. Spinning rod guides are much bigger than casting rod guides.
To replace them you need to cut off the old threads - they may look like tape on the rod, and some companies use a type of tape to put them on. If it is tape, remove it. Then you put the guide on the rod by wrapping thread around the guide foot and rod. Dental floss will work but a you should be able to find some rod thread.
Wrap the thread tightly working from the end of the foot to the guide. After the thread is wrapped, you can coat it with epoxy or even clear fingernail polish.
Some tackle stores will replace guides for you, and if you can find a local rod builder they can replace it for a few dollars.