We can begin a sentence with an -ING verb. In this case, it is a gerund and it acts as the subject:
Losing weight is hard to do.
In the next example, the -ING verb is a present participle, indicating two things going on at the same time. Note the use of the comma:
Walking in the forest, I listened to the sounds of the birds.
This second example is really a short form of this sentence:
While I was walking in the forest, I listened to the sounds of the birds.
Here is another example:
Driving through town, I noticed the new construction site.
(While I was driving through town, I noticed the new construction site.)
We can begin a sentence with an infinitive (to + verb). The infinitive can be the subject:
To err is human.
We can start a sentence with an infinitive clause if it shows purpose:
To make a tasty cake, you need a lot of butter.
We can also use ‘in order to’:
In order to make a tasty cake, you need a lot of butter.
Note the comma usage. The subject of the sentence is ‘you’. Or in other words:
You need a lot of butter to make a tasty cake.