To understand why they did it, looking at others who do it still might help.
Indians and some bhuddists worship the peepal tree, a kind of fig, which is native to their subcontinent, not only as many storys of gods are connected to it which makes it a suitable residence for them, the bhudda himself was said to meditate below them to reach enlightenment.
Much more practically to people back then was its antimicrobial compounds. If you were an indian 300bc and ill, that tree could make an important difference.
The romans too, worshipped a figtree in their capital connected to its founding story, the Ficus Ruminalis which was replaced sometimes when it died-probably from an offshoot of one of its fruits.
In Indochina bhodi trees are especially sacred when they are said to stem from the same line of fruit as the one the bhudda sat under.
But such foundation events for holy lines of trees we were cut off from, so they are useless for us.
In Germany, peasants often refused to chop down elderberrys and spirits where said to reside in them which needed thanks until the 19th century and people planted them along their homes for good luck. Also, academics at the time and today are pretty sure that through many tales and in some regions namings and leftover rites, a godess was connected to it, maybe frigg.
Elderberrys too have antibiotic properties.
Germanics connected the oak to Thunar/Thor, romans to Jupiter the thunderer.
The Oak grows best isolated on fields, were it reaches impressive size prone to lighting strikes which it often survives.
Not a tree, but a spring connected to the native-roman composite deity Apollo-Grannus which was thought to reside in it was deemed sacred and today has been found out to contain minerals with antiseptic properties.
The basic thought is thus: certain spots in nature and the world make your life better or impress in an unusual way. You need them and appreciate them, thus you connect a benevolent form to them.
With greater organisation the formation of uniform storys and myths, by whatever insight mundane or divine, get spun and add to certain tree's prestige as adobe of something higher that made them for you too and can dwell in them at will.
So you do the obvious and worship/ thank the spirit where its gift to you and its residence is located-the tree. This relationship of taking and giving (votive offerings were common and are kinda similar to how catholics do it with certain chapels associated to saints.) gives birth to tradition-a codified relationship to the deity which lasts generations is established and more complex attributes of it reveal themselves to the generations of men that ponder about the whereabouts of this relation.
Same logic behind citygods and those of other places I guess.
>How to find
if you are not a villager who can acess a tree connected to stories of significance often (like an oak.), or know of one with an already established bond which warrants pilgimage(there are none anymore..) id cease the thought and settle for a kind of idolatry in your urban apartment that doesnt needs 10 metres space above and around it.
If there would be a pagan rural community tho, using a tree as communal focal point for the worship of a certain god associated to it by what our ancestors established as relationship then there might be a point to just try until it is made sacred by the virtue of multigenerational worship.