What you need is a parser and there are parsers online. https://www.link.cs.cmu.edu/link/submit-sentence-4.html
| | | | |
my favourite.a sport.n is.v hiking.n
(S (NP My favourite sport)
However computers have difficulty with this kind of sentence because "Hiking" can be interpreted as a participle/gerund, with "is hiking" as the present continuous form of the verb "hike"; or "hiking" can be a noun. Compare
My favourite girl is hiking.
My favourite sport is hiking.
So the correct parsing requires you to understand the meaning of words in context. But the meaning of the words also depends on the parsing....
The computer finds four different possible parsing of your sentence. The "correct" one (in the sense that it is consistent with the assumed meaning) is that "hiking" is a noun. And in total "My" is a determiner, "favourite" is an adjective and "sport" is a noun. "My favourite sport" is a noun phrase and subject of the copular verb "is", and "hiking" is a noun that is the complement of the verb.