To turn off Nearby Sharing, go to Settings > System > Shared Experiences, and toggle off the Nearby Sharing option.