Getting published is not easy. Getting a literary agent helps but getting an agent is no small task.
For example, 5 Easy Ways to Keep Your Work from Ending Up in an Agent’s Trash” by Bethany Cadman (author of Doctor Vanilla’s Sunflowers) lists
not following the submission guidelines,
poor spelling, and
bad query letters among the reasons writers get rejected.
Assuming that you avoid the common mistakes here is a selection of advice from writers about getting a good literary agent.