If this happens in the course of preparing a volumetric solution, what should be done?
If you have plenty of solution and reagents, the solution should be prepared again, because the volume is not the nominal volume written on the flask. However, the proper trick to fill the volumetric flask is to use a dropper when you are about to reach the calibration line. Experienced hands can use a squeeze bottle until the end but the chances of this mistake are high.
However, if the solution was was just a single sample solution (provided by somebody else, or the compound is too expensive or rare), slightly overfilling the volumetric flask is not the end of the world. You can mark the liquid level after proceeding normally (dissolve and invert several times). With a help of a high quality volumetric syringe or gas tight syringe (e.g., 2.5 mL Hamilton used in gas chromatography injections) draw the excess liquid until the liquid level is back to the calibration line. Measure that volume in the syringe and add it to the nominal volume of the volumetric flask.
If the volumetric flask had a nominal volume = 100.0 mL and you had to withdraw 1.80 mL then the total volume would be 101.8 mL for molarity or other concentration calculation.