Basic Encryption and Decryption related question I recently started studying cryptography and got interested in the subject. But I got this doubt when I was studying the encryption scheme. Even though we encrypt our message and change it into ciphertext, this ciphertext is still available to the attacker. So, what if the attacker modifies this ciphertext and sends it to the receiver? Then the receiver cannot decrypt the message right..?
For a block cipher

A block cipher is a PRP, a Pseudo Random Permutation. That is: given a key it generates a permutation of all possible plaintext blocks to all possible ciphertext blocks. So there is a bijection between each plaintext block and each ciphertext block, i.e. each possible plaintext block is assigned its own ciphertext block. So there is a 1:1 relation between the plaintext block and the ciphertext block given a specific key.

This doesn't of course happen in practice, this is just a mathematical description. Instead each plaintext block that is inserted into the block cipher gets transformed into a single ciphertext given a specific key. Without the key you cannot reverse this process (unless the cipher is broken). It is of course also impossible to retrieve the key from the plaintext and ciphertext. Decryption performs the reverse operation.

Now what happens if we change a bit in one of the ciphertexts? Well, you get another ciphertext, which in turn maps to a different plaintext. This plaintext can be any of the remaining $2^{128}$ plaintext. As all possible 128 bit plaintext are possible you get one block of random garbage. The cipher just reverses the mapping without checking that you get the wrong plaintext block!

Now this explains what happens with a block cipher. How the change is otherwise handled depends on the mode of operation that the block cipher is used for (ECB, CBC, CFB, CTR etc). If you introduce errors in the ciphertext you would have to look at the error propagation property of the mode of operation.

If the block cipher is CBC and padding is applied then an attacker may have enough information to perform a padding oracle attack. This means that the attacker can use the unpadding performed by the receiver to quickly and completely find all the plaintext from the message without breaking the block cipher. So in this case introducing a modification of the ciphertext may give the attacker enough power to find out all information about the message - full loss of confidentiality!

For stream ciphers

For stream ciphers (that generate a key stream) the situation is significantly easier. With a stream cipher (or OTP) changing a single bit in the ciphertext simply changes the bit at the same location in the plaintext.

Preventing modifications

Modification by an attacker can of course not be prevented by any algorithm. What is possible though is to add an authentication tag to the ciphertext. An authentication tag is usually computed using a Message Authentication Code or MAC. By verifying the MAC against the plaintext or ciphertext the receiver can detect if the integrity of the message is still intact.

Many new protocols, including TLS 1.3, use so called authenticated ciphers. Authenticated ciphers always create an authentication tag internally. So it should always be possible to verify that the ciphertext is not changed in transit.