First make the method generic:
private T DataTableToObject<T>(DataTable table)
and then change it up a little:
var obj = Activator.CreateInstance(typeof(T));
and at the end of the method remember to cast it:
return (T)obj;
and now, when you call it, it will look like this:
MyCustomObject custObj = DataTableToObject<MyCustomObject>(dataTable1);
And now how to populate the fields, I would do something like this:
foreach (var col in table.Columns)
{
var propInfo = obj.GetType().GetProperty(col.Name);
if (propInfo == null) { continue; }
propInfo.SetValue(obj, row[col.Name], null);
}