Have you looked at the tutorial, at
or the microcontroller interfacing tutorial at
A sensor with an NPN output can be wired directly to an I/O pin on the microcontroller, with a pullup resistor, and possibly with some series resistance to help protect the pin against damage. For example, you might wire from the sensor output to Rpullup ~ 10k, and from the other end of the pullup resistor to 5 V. Then you would wire from the sensor output to the I/O pin, through Rseries ~ 10k.
Rseries isn't really necessary; you could wire directly from the sensor to the pin. But if there is an ESD (static electricity) event, or if a high voltage accidentally gets applied to that pin, then the resistor limits the fault current and increases the odds that the micro will survive. But as that series resistor--and the pullup resistor--get bigger, the noise immunity decreases, so it's a tradeoff. A few nanofarads from the I/O pin to ground would also help protect the pin, although they will slow things down by a few tens of microseconds.
A relay can be driven with a single transistor, as in the interfacing tutorial. Remember the diode, since a relay presents an inductive load.
A message may be output onto a serial LCD, with the "formatted string over UART" op.