Getting started with literary agents and getting published

To those who have experience of this, where did you start? I’m from the UK, so does anyone have any recommendations?

I want to look into this quite early (I have a timeline in my head 😂) but don’t know where to start?

Are agents 100% necessary to get published?

Any advice or wisdom would be much appreciated!!