Generally, to modify a custody/visitation order you would file an Order to Show Cause to get a hearing date for modification of custody. If it is urgent, such as some possible danger to the children, you could go into court on what is known as an "ex-parte" basis by giving the other party at least 24 hours (generally) notice of the hearing. At that time, the court will review your declaration and decide whether or not to make some temporary custody/visitation orders until you return to court for a full hearing within 3 weeks.
This response is general in nature and should not be considered legal advice.