Mr Barilaro, who holds the seat of Monaro, said that as NSW prepares to emerge from the lockdown caused by an outbreak of COVID-19 it is time for a "refresh".
"I have decided now is the right time for me to hand the reins over to new leadership, and resign as Deputy Premier of NSW," he said in a statement.
"Serving as Deputy Premier of NSW, as Leader of the NSW Nationals and as the Member for Monaro has been the honour and privilege of a lifetime."
Mr Barilaro has called a Nationals party room meeting for Wednesday when he will formally resign and call for a ballot for a new Leader.
Once that is settled, Mr Barilaro will work with the Speaker and the Electoral Commission to determine a date for a by-election in his seat.
Mr Barilaro's sudden resignation comes in the wake of the announcement by Ms Berejiklian on Friday that she was stepping down as state premier, and ahead of a NSW parliamentary Liberals meeting on Tuesday to decide on her replacement.
"The next premier has big shoes to fill, but I wish them well and the best of luck, I will be cheering from the sidelines and I am excited for what is ahead under their stewardship," he said.
Mr Barilaro said he was deeply grateful to the NSW Nationals and grassroots members for allowing him to serve.
"People are sometimes quick to write off the National Party, but it's the Nats in government who are, and always will be, the praetorian guard of common sense," he said.
During his time as deputy premier, Mr Barilaro oversaw policy responses to drought, the worst bushfires in living memory, severe storm and flood disasters, and a one-in-100 years global pandemic.
"It was a privilege to work with our communities to endure and recover from those challenges," he said