There is a huge class of functions that are trivially guaranteed to halt: Everything with a finite number of loops, with an upper limit for the number of iterations for each loop determined before the loop is started.
If you have a random program, it can be difficult to prove whether or not it halts. Programs that are written for a purpose are usually much easier.