There are some "do by yourself" methods to discover your bike size. Have in mind that they will give you a standard idea of what to buy, but a professional for final adjustments is always recommended.
Method one: Your height / Bike Size
Method Two: Calculating the bike size
Take off your shoes; stand with your legs far about 15-20 cm(6” – 8”) from each other; measure the height from the ground to your crotch.
Have in mind what model of bike you do want: Mountain bike, city bike, gravel bike, or road bike.
Calculate the right size according to the bike you had chosen:
City bike – Leg inseam (cm) x 0,685 = Your frame size
Mountain bike – Leg inseam (cm) x 0,66 = Your frame size
Road bike – Leg inseam (cm) x 0,70 = Your frame size