user14457: In a video I'm watching (requires register), it has this setup.
[FEN "r3k2r/pp1qn1pp/2p2p2/8/3P4/5N2/PP2QPPP/2R1R1K1 b kq - 0 1"]
[startflipped ""]

The instructor says:

The king cannot escape, he cannot castle kingside or queenside,
because of the white's pressure on e7 [...]. Black wants to escape
this pressure by castling by hand.

I don't understand why can't black castle. It won't castle from, through, or into check. Why is it?

user14492: There is one possibility when castling would be illegal - if king has moved earlier in the game - then the move would be illegal.

user10295: Executive summary:
Black actually can castle, but if he does castle he will lose the knight and the game (due to material loss).
Detailed answer:
Black and White have equal material.

The black knight is protected by two pieces: the king and the queen.
The black knight is attacked  by two pieces: the queen and rook.

If the king castles, the knight will be protected only by the queen, and White will be able to win the knight which will lead to a big material advantage: a knight, which is worth about 3 points.
"Castle by hand" (meaning moving the king and the rook over several turns until they reach a castle position) will allow Black to keep protecting the knight. (E.g. By moving the king to F7 to protect the knight, followed by a rook to E8, etc.)

14457: <p>In a <a href="https://www.chesscademy.com/videos/the-king-in-the-center" rel="nofollow noreferrer">video I'm watching</a> (requires register), it has this setup.</p>
<pre><code>[FEN &quot;r3k2r/pp1qn1pp/2p2p2/8/3P4/5N2/PP2QPPP/2R1R1K1 b kq - 0 1&quot;]
[startflipped &quot;&quot;]
</code></pre>
<p>The instructor says:</p>
<blockquote>
<p>The king cannot escape, he cannot castle kingside or queenside,
because of the white's pressure on e7 [...]. Black wants to escape
this pressure by castling by hand.</p>
</blockquote>
<p>I don't understand why can't black castle. It won't castle <a href="https://en.wikipedia.org/wiki/Castling#Requirements" rel="nofollow noreferrer">from, through, or into check</a>. Why is it?</p>
 14492: <p>There is one possibility when castling would be illegal - if king has moved earlier in the game - then the move would be illegal.</p>
 10295: <p><strong>Executive summary:</strong></p>

<p>Black actually can castle, but if he does castle he will lose the knight and the game (due to material loss).</p>

<p><strong>Detailed answer:</strong></p>

<p>Black and White have equal material.</p>

<ul>
<li>The black knight is protected by two pieces: the king and the queen.</li>
<li>The black knight is attacked  by two pieces: the queen and rook.</li>
</ul>

<p>If the king castles, the knight will be protected only by the queen, and White will be able to win the knight which will lead to a big material advantage: a knight, which is worth about 3 points.</p>

<p>"Castle by hand" (meaning moving the king and the rook over several turns until they reach a castle position) will allow Black to keep protecting the knight. (E.g. By moving the king to F7 to protect the knight, followed by a rook to E8, etc.)</p>
