The question is not stated clearly. I suspect you are trying to play music from what is often called a lead sheet.
On a lead sheet the melody line notes are shown on a staff with harmonizing chords indicated above it by name; this is common in popular music and jazz.
The chord is indicated by name only, rather than written as additional notes on the staff, for instance "C" or "G7" or "Am". You need to acquaint yourself with the basics of chord construction and notation to understand what notes each name implies.
I would recommend that you look at jazz guitar sites to get some idea of what is going on with notes versus chord names.
The next related subject is chord voicing. When you know the basics of chord construction it will be clear that any named chord can be played in many positions and inversions (look up chord inversion also) around the neck.
The idea is usually to select a chord voicing that places the desired melody note at the top of the related chord. These are the essentials of the jazz/pop guitar style known as "chord-melody".
Often many of the exact chord notes are left out with little affect on the total sound. In this style you need not play every note in any given named chord, sometimes tonic and third or other simple combinations will suffice and ease your left hand fingering problems without diminishing the musical affect.
Often the chord will only sound on one or two notes in any given bar or phrase. Think of the named chord as a guide. Your ear and good taste will come to guide you to how and where to play it.
Of course in classical music every chord is written out and played exactly as written, but I don't think that is what you were questioning.