I learned about the function of prepositions

I learned about the function of prepositions from different sources but I am still confused.
I would like to get some opinion from this helpline also regarding the following question.

What is the function of a preposition in a sentence?

Hello,

Someone once said that prepositions are the GLUE of English.

Look at what would happen if your first
sentence did not include the prepositions:

“I learned the function prepositions different sources but I am still confused.”

Most books say that a preposition relates two linguistic elements to each other.

Look at how a preposition can change the meaning:

I will visit you BEFORE the concert.
I will visit you AFTER the concert.
I will visit you DURING the concert.

James

Can I say: “I will visit you at the concert.”
OR “I will visit you in the concert.” ?

Please comment.

You wouldn’t normally visit someone at/in a concert at all. In James’s sentences the concert would not be the place where the visiting occurred.
‘Visit’ is the wrong verb in your context.

I will see you at the concert.
I will see you in the concert.
Both are correct.