Is there a way to change the font size of some UI elements like the one shown on the photo?
No. You cant change the UI elements individually. You need to to set the proper resolution and Scale as your “taste” in Windows Display settings. (BTW, the scale is better if it is up to 150%)