How you do it, and what extra factors there are (such as time limits, affection bars, gifts, and raising your own abilities) vary from game to game and have become more and more complex over time.
But the point is still the same - you the player takes the role of someone trying to win over the girl or guy of your choice!
Typically this is done through conversations where you choose which options to say, as well as elements like gift-giving and dates.
Many dating simulators also give you a chance to level up stats like charm or physique to help you win over your crush.
Whether you're looking for a serious game or a causal one, with varying levels of romantic content, there are enough dating simulators out there that you can probably find one.