How to access Sitecore Database Programmatically

We know that Sitecore stores data in multiple Databases. To know more about Sitecore Databases check out Difference between Core, Master and Web Database in Sitecore. So How to access Sitecore Database Programmatically in C#?...