You need to use the [Obsolete] attribute.
Example:
[Obsolete("Not used any more", true)]
public class MyDeprecatedClass
{
//...
}
The parameters are optional. The first parameter is for providing the reason it’s obsolete, and the last one is to throw an error at compile time instead of a warning.