how to develop a filter in wordpress to let the user filter the page content depends on the date (newest to oldest etc…)?

I would recommend looking at FacetWP plugin, which is a paid plugin, but it does all of this and more:

https://facetwp.com/

If you want to manually do this, there’s numerous ways based on what specifically you’re referring to (blog posts? custom post types?):
Sort posts by Date (DESC) and by Title (ASC)

WordPress also has native widgets like categories and others that will do most of this for you.