What can I do if I get private key of signing algorithm in Digital signiture I am confused in digital signature. what is use of encryption with private key and decryption with public key. Using public key we can decrypt the signature then what is use of private key privacy. Explain in detail.
When talking about digital signatures, the private key is what proves the authenticity of the signature, precisely because it is private.

The use case proceeds like this: I choose a private and public key pair. Because I chose it, only I know both keys. I then send a message and sign it by using my private key, typically by encrypting a digest, hash, or checksum of the message with the private key, so that it can only be decrypted with the matching public key.

I publish my public key for others to verify my signature with.

The receiver then manually computes the same digest of the message, decrypts the signature I sent along with it using my public key, and compares the two. If they are identical, the only way that is possible is if I am indeed the person who has the private key and published its matching public key. Otherwise, I would not have been able to properly sign the message without my private key.

This works because it is exceedingly difficult to compute the private key from the public key, so much so that it would take a very long time even on a supercomputer.

You might ask at this point, why is the signature an encrypted digest or hash of the message? If the message differs in any way (was tampered with or intercepted, as with a man-in-the-middle attack), the digest won't match whether it's decrypted correctly or not. So tampering with the message necessarily invalidates the signature, because it's a digest of the message itself, proving it's the same message sent by the person who signed it.