How to find what to do in machines?

Like I saw a machine , now main problem is what to do next and further

Enumerate the machine. Enumeration is the key to everything.
Think of it like this - you’re a robber that wants to rob the bank. You can’t just bust in without thinking because it won’t work. Instead you look around the place and search for holes in security, understand the building, the guard’s routine, where the vault is, maybe the code for the vault etc.
If you don’t enumerate the machine and try to hack it won’t do anything. You need to get to know the box, understand how it runs, what it runs, what versions of software there are on the box, and only then you can think of how to hack it.