There are lots of online courses, including free ones, which could give you an idea of whether you like coding, but not all courses are equal, of course.
I did an MSC conversion in Computer Science back in the '90s, having originally done history and worked in libraries, which was where I saw the potential for IT - I figured studying it for a year was long enough to tell whether I really liked it or not, and more tech knowledge wouldn't hold me back, whatever I ended up doing. I am still working in IT.
There are loads of routes in these days - sometimes companies have internal training available to help people change career. There are returnships. There are apprenticeships open to a wide range of people, not just school leavers, or you could go back to academia. Or you could gain knowledge and experience on your own. There are also loads and loads of different roles in tech these days, not just coding, so there's likely to be something which suits almost everyone. Having other experience us anow advantage, too, knowing how businesses work, how users think (often different from what techies would like them to do!)
Don't know much about accounting, but I do have a friend who changed to it in her 30s, so it's possible.
Apologies for any typos, but am at an eye clinic and eye drops mean I can't see properly to know if I mistyped anything...