There are several ways to make a TV do stuff, but details vary a lot.
HDMI CEC is a way for HDMI-connected devices to control the TV. Turn it on or off, switch source (input), possibly adjust volume. It requires a device to be connected to the TV over HDMI. The usual devices are set-top boxes (e.g. cable box, or TV box from your ISP), players (e.g. Apple TV, Google Chromecast, Amazon Fire TV, etc.). Some may be controllable remotely, others not. Also, depending on the combination of box and TV, you may or may not be able to control everything. For instance, the Apple TV does not control volume over HDMI CEC, it's the remote using IR for that.
IR remote control. Nearly all TVs will support IR remote controls (even though some will also support Bluetooth or other RF remote controls). There are as many standard as there are brands, possibly more, but this is an old topic so there are solution. Again, some boxes have an IR output, others not. You will often have to tell it the type of TV and/or start by a "learning" procedure.
Displaying stuff on the TV will usually be done by sending a video signal over HDMI these days, though of course previous interfaces may still be around. The same boxes as above, as well as full-featured PCs are options for this. Note that we are talking sending a full video+audio signal, not just something overlaid on whatever is already on the screen. To send the video to play, there may be several options depending on the box:
- it may allow you to "cast" a video, i.e. share the screen from your PC to that device
- it may allow playing a video from a source on the network, with something like a VLC player
- it may have storage and act as a file server. You upload your video there, and can then play it from there.
- it may support external flash storage (SD cards, USB sticks) or external hard drives. You put the video there, and play it from there.
Some of the boxes will allow full remote control, while others will require you to use a remote to control them and start playing the video from whatever source it supports.
In detail:
mess with the volume
May be possible over HDMI CEC. Otherwise IR is the solution. Of course if you control the source you can usually adjust volume there (as opposed to controlling the volume while the TV is using another source you don't control).
turn it off an on
Usually possible with HDMI CEC (both my Apple TV and my Android TV-based set top box manage to do it with my Samsung TV, for instance).
and maybe even display text (maybe even media if possible).
See above for possibilities. Again, that's if you want to have that media played instead of anything else, rather than on top of it.
Depending on your actual needs/use case, your technical proficiency, the actual TV, what devices you may already have, and more, there are probably dozens of different solutions which may give you more or less control, though some may require a lot more expertise than others.