I walked up to the ATM.
I looked up at the sky.
The way I see it, "up" is an adverb in both sentences. Meanwhile, "to the ATM" and "at the sky" are prepositional phrases.
English Language Learners Stack Exchange is a question and answer site for speakers of other languages learning English. It only takes a minute to sign up.Sign up to join this community
'Up' is a preposition here. According to Merrian Webster definition 3, 'up' is a preposition used in similar fashion as your examples.
For the first example sentence in the question, the applicable definition is 2a - "in a direction regarded as being toward or near the upper end or part of".
For the second example sentence in the question, the applicable definition is 1a - "used as a function word to indicate motion to or toward or situation at a higher point of"
Edit based on BillJ's inputs: Therefore, the prepositional phrases in your sentences will be "to the ATM" and "at the sky".