What you need is a parser and there are parsers online. https://www.link.cs.cmu.edu/link/submit-sentence-4.html
+-------D*u------+
| +----AN---+--Ss--+--Ost-+
| | | | |
my favourite.a sport.n is.v hiking.n
Constituent tree:
(S (NP My favourite sport)
(VP is
(NP hiking)))
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.