Custom_Object__c co = new Custom_Object__c(Name='TEST', Date_of_Visit__c=2019-06-06); insert co;
closed as unclear what you're asking by Pranay Jaiswal, glls, battery.cord, Jayant Das, Vijay Ganji Jun 10 at 6:41
Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
You haven't provided much in the way of details here, but I'd suspect that your issue is with the date you're trying to set to
I know that SOQL queries can handle date literals, but I don't think that the rest of Apex at large can.
You should create an instance of the Date class using something like
Date.valueOf(), and set your Date field equal to that instead.