Variety of methods. When alone use a tripod (or a rock) a timer, or a remote release.

Other times I just hand the camera to whoever I'm hiking with, or even a stranger.

The first two pics were by a stranger at the landing. The last one was when I was killing time waiting very early in the morning and decided to wander around. Put the camera on a rock and used the remote release. The release has a 2 second delay so I have time to palm it out of sight.