Self-publishing vs traditional publishing

Hey everyone! I have no idea if this question has been asked before… and I’m nowhere near needing to think about publishing but I was curious anyways.

If you start the author journey with self-publishing your books, is there still a possibility of getting an agent eventually — either for those books or for new ones?

If anyone’s done this I’d be so interested to hear what your experiences have been like with both forms of publishing!