How to get the number of the vertex closest to the object or recast or mouse position

How to get the number of the vertex closest to the object or recast or mouse position (Note I need the number of the vertex, not the position)

cause I want to do that when I click on the mouse so the closer vertex move up so if you have other Ideas tell me pls

@Bunny83 @Eric5h5 @robertbu @aldonaletto @duck