Hello @abdul.qadir5001 ,
the route to null0 is called a Discard route .
Its role is that of providing a way to discard packets with a destination in the summary route for which there is no known subnet.
This is done to avoid routing loops without the discard route a packet for a non existing subnet that is part of the summary route could be sent back towards an OSPF default route and then it will be sent back to the router that originated the summary route creating a routing loop until TTL expires.
This is the role and function of the discard route ( route to null0)
Hope to help
Giuseppe