I've run into many very long climbs in the mountains here. For each of them, there was always a "first time."
The most important thing I think about on a long climb is cadence, and riding with (only) light pressure on the pedals. If I feel like I'm working too hard, I drop down to a lower gear. If I'm not working too hard, I shift to a higher gear. The more tired I am, the more I think about maintaining a nice, smooth cadence, and trying to make perfect circles with my feet. For some reason, a long time ago I decided the worst thing to do on a long climb is to get sloppy, so I think about not getting sloppy.
And I try to remember to relax. I find that moving my hands off the hoods or drops and putting them on the flats of the handlebars right next to the stem helps me relax. It opens up your chest and lets you take nice deep breaths.
The final thing I think about on a long climb is how happy I am that I don't live in Texas any more where the sun beating down on your back during a long climb will bake you alive before you ever make it to the top!