This method might not be the most efficient but is simple and does the job.
It performs two operations: firstly it calls .ToString() which is basiclly a serialization, and then the deserialization using Newtonsoft nuget (which you must install).
public T Format<T>(Object obj) =>
JsonConvert.DeserializeObject<T>(obj.ToString());