When you "get the opportunity" to do something, it means that you are allowed to do something that you think is good.
An "opportunity" is usually something that you want to do to improve yourself, like something related to work, or to an activity that you like doing such as sports or music.
When you're talking about the person who does the action, you say "get an opportunity":
She got the opportunity to meet with a lot of famous film directors and producers.
When you're talking about the person who lets you or helps you do the action, you say "give ___ an opportunity":
Our mission is to give disadvantaged children the opportunity to grow and achieve their dreams.