@misbahu-
Library is nothing but the internal function of a particular contract you will use in other contracts as well. That's why you declare library.
Example -> You can create a Square Root function inside contract and make it internal.
But you feel other contracts may also need it so you create a library and import the function from there.
Thinking this way simplify things !!!
aayushmayush