How to disable IPv6 on OpenBSD?

You must build a custom kernel that lacks the INET6 option. But the OpenBSD maintainers seem to advise against this.

 -inet6          Disable inet6(4) on the given interface and remove all
                 configured inet6(4) addresses, including the link-local
                 ones.  To turn it on again, assign any inet6 address or
                 run rtsol(8).

this if from `man ifconfig'.

 family      Specify which type of Internet protocol family to prefer, if
             a host is reachable using different address families.  By
             default IPv4 addresses are queried first, and then IPv6
             addresses.  The syntax is:

                   family family1 [family2]

             A maximum of two families can be specified, where family can
             be any of:

                   inet4     IPv4 queries.
                   inet6     IPv6 queries.

this is from `man resolv.conf'

Custom kernel is not OpenBSD way to go! Do not ever ask for help with custom kernel, you don't understand technical details anyway :)