I was wondering that what actually is cipherText-only attack and how the One Time Pad Encryption cant be broken by this attack?
A Ciphertext-only attack is what it sounds like, it's a type of attack model in which the attacker only knows the ciphertext (encrypted text) and has no knowledge of the plaintext (decrypted text). In practice though, usually the attacker has at least some knowledge of the plaintext, like the set of characters used or the language used.
A one time pad can't be broken because there are many answers (that make sense) given a ciphertext, so there is no way to know the actual intended plaintext. Generally encryption methods yield nonsense if decryption fails for most part, so it's possible to try out all possible keys until you reach an answer, but with something like OTP, this is not possible.
As a simple example if I give you "xxxx" as a ciphertext and tell you to break it, the answer could be "what" or "when" or "past" or any other 4 character thing depending on the key, you have no way to know which one it is.