Sieve methods for varieties over finite fields and arithmetic schemes