following the august 2018 resignation of former prime minister malcolm turnbull, sharma was selected as the liberal party candidate for the resulting wentworth by-election. in response to criticism from john hewson, sharma has stated that the liberal party has a "good record" on climate change, and is "doing enough" to meet the paris agreement. independent candidate kerryn phelps won the by-election, but sharma was pre-selected again to run as the liberal candidate for wentworth at the 2019 australian federal election, and won the seat from phelps.