How to choose a data from a database ?

In my website I have a database which contains several dates. I would like to change my text in order to show the next date of the database. For instance, my database has : 2021-03-15, 2021-03-18,2021-03-25 and so on… I would like that my text shows the next date which is 2021-03-18. And this would change each day. Can somebody help me ?
Sorry for my english.
Thank you for your help!

Auto changes:

You can trigger code:

  1. query() - get the items
  2. Do some actions on the data by using your own code
  3. bulkUpdate() - save the updated items