Gene function can be predicted from the protein sequence using a database of known protein sequences. The information in the database will have known sequences and what function the proteins with those sequences have. By searching the database with the protein sequence, it is possible to make good guesses about function of a newly discovered sequence which is very similar to an already-known one.
Work Step by Step
The logic here is like going to the library and wanting to know more about, say, brick laying. If you already have one book about bricklaying, you look up its call number and go to that part of the library shelves. You will probably find books on the same or very similar topics nearby.