As everyone has said, just time, time, time.
And tuna!
We had a feral Tom cat arrive when I was a kid, it was so spicy the RSPCA officer couldn’t catch him, but he’d let a 9 year old me stroke his head (the cat, not the RSPCA officer lol) so with us he stayed.
He went from a gangly, matted young cat (about 6 months when he arrived) to a magnificent, long haired behemoth of a beast. Friendly, loving, comical, utterly loopy.
Ginger lived until he was about 17, he’d go out & sun himself on our neighbour’s window ledge. Until one day he stretched out, fell asleep, and rolled, stiff as a board, into her flower bed.
Taming him took a lot of time, patience & love. And the smellier food the better! A little stroke here & there turned into tentative sitting on laps, to being able to stroke him whilst on your lap (at first, you daren’t move if he sat on you for fear of losing your eyes), to snuggling in the evening watching telly.
Teddy is gorgeous, love his heart on his head! Good luck with the future, it’ll be spicy, frustrating, but brilliant!