I have a hardwired ceiling light . I didn't know it was not switched. What is the easiest way to control (on/off) it?
Easiest?  Probably one of these:

(Image curtesy of Lowes; not an endorsement)
That will add a pull chain switch to a simple light socket.  Extra chain can be clipped on if you need longer length.
Other options would be:

Replace the fixture with one with a built-in switch
Run some wiring to add a switch loop to a standard light switch (possibly required by code if the room doesn't have another light)
Add a smart relay module behind the fixture in the box, and control the light with an app, remote, or smart home device
Like Phil suggests, put a smart light bulb in the fixture and control the light with an app, remote, or smart home device