If using C# CSOM you can try something like this ContentTypeCollection Extension
// taken from link above!!!
public static class ContentTypeExtensions
{
public static ContentType GetByName(this ContentTypeCollection cts, string name)
{
var ctx = cts.Context;
ctx.Load(cts);
ctx.ExecuteQuery();
return Enumerable.FirstOrDefault(cts, ct => ct.Name == name);
}
}
Once you return the content type by name using the extension method, you should be able to pull the ID off of the variable.
var siteCT = ctx.Site.RootWeb.ContentTypes.GetByName("<Name>");
var CTID = siteCT.Id;