Where do I USE add_rewrite_rule?

add_rewrite_rule is for converting a URL structure to query vars and routing requests through index.php, you can’t point to other URLs and use flags like you would in htaccess rewrites.

for what you’re trying to achieve, doing it via htaccess is the simplest way. your rule should work if you just remove the leading slash:

RewriteRule ^content/([^/]+)/([^/]+)\.htm$ /content/$1/ [NC,R=301,L]

This would need to go before any WordPress rewrites if you’re using pretty permalinks, otherwise this rule will never be reached.